Some Basic Powershell Commands

Check Powershell info: $PSVersionTable Wget, cURL in Powershell native: Invoke-WebRequest <url> -OutFile <filename> Count number of files and sub-directories (Get-ChildItem | Measure-Object).Count count files only (Get-ChildItem -File | Measure-Object).Count count directories only (Get-ChildItem -Directory | Measure-Object).Count count recursively for all files and sub-directories: (Get-ChildItem -Recurse | Measure-Object).Count List files recursively dir -Recurse Get domain infos: Get-ADDomain Get-WmiObject -Class Win32_NTDomain

Oct 14, 2022 13:00 · liucreator

Windows CMD VS Linux Terminal

Same commands cd - change directory In Windows also act as pwd date - display or set date dir - display contents in directory Please use ls in Linux echo display some messages exit quit the terminal/command prompt help display informations of Windows/Linux commands mkdir create a directory more display outputs by screen view rename rename files mv in Linux does the same but more rmdir remove directory only empty directories in Linux shutdown poweoff the machine also able to restart in Linux sort sort some inputs tree display directory structure graphically needs to be explicitly installed on most Linux distrubutions Different commands but same functions check disk status chkdsk in Windows fsck, hdparm in Linux clear screen Ctrl + L should work in both Linux and Windows cls in Windows clear in Linux start a new shell/interpreter cmd in Windows bash, zsh or any other shell compares contents of files comp or fc in Windows diff in Linux copy files copy in Windows cp in Linux display and manage disk partitions diskpart in Windows gdisk, fdisk, cgdisk, cfdisk in Linux delete files del or erase in Windows rm in Linux search for string find or findstr in Windows grep in Linux display file type ftype in Windows, also can modifiy file extension associations file in Linux move files move in Windows mv in Linux prints a text file print in Windows cat does the same thing and more Display system/kernel version ver in Windows uname -r in Linux Display and set time time in Windows timedatectl in Linux(SystemD only)

Oct 11, 2022 14:00 · liucreator