A collection of Snippets, commands and other useful things for Windows that I often forget, and need to lookup.
if ((Get-Command cmd -ErrorAction SilentyContinue) -ne $null) {
# Do Something
}
Remove-Item -Recurse -Force folderName
. $Profile
which
(Get-Command cmd).Path
NB: PowerShell 3+
which
where.exe [cmd]
To create .Directories in File Explorer append a “.”” to the directory name. e.g.
.folderName.
To create .Directories in Command Prompt or Powershell:
mkdir .Directory
To create .Files in File Explorer append a “.” to the file name; e.g.
.fileNsame.