Visit https://adamtheautomator.com/powershell-environment-variables/
See: https://learn.microsoft.com/en-us/answers/questions/4184/your-organisation-has-deleted-this-device
Run this command in admin mode
Open cmd/powershell in admin mode
dsregcmd /forcerecovery |
Get-help
- return information on how to use the help system.
Get-help sort
- will return information on the sort cmdlet
Get-help sort -Examples
- will return examples on how to use the sort cmdlet
Sort the outputs of another command.
Return really useful information about an object of any kind.
Returns all the commands available on your system
This will take the output of get-command which is currently only going to list commands that are related to the package management and pipe it into sort which then sorts it by noun and verb.
The above command could be partially done with - get-command | findstr packagemanagement | sort noun
, verb
Get all available cmdlets and store them in a file called allcommands.txt
Display all of the contents of the file allcommands.txt to the screen
Read the contents of the file allcommands.txt, redirect the output to Measure-Object which then counts the number of lines in it
Find all packages provided by chocolatey
find-package | findstr chocolatey | sort > chocolatey-packages.txt
Find all packages provided by chocolatey and save the results in a file called chocolatey-packages.txt
Search the file system for a particular file with a particular file name pattern
Get-ChildItem -Path .\ -file -filter *.pem -Recurse
From the current location recursively search for any files ending with .pem
$env:path -split ';'
Start-Process -NoNewWindow ping google.com
Or you can create a reusable shortcut function, and store it in a script file that is then on the PATH
function bg() {Start-Process -NoNewWindow @args}
netstat -aon | findstr ":80" | findstr "LISTENING" |
OR
Get-Process -Id (Get-NetTCPConnection -LocalPort Your_Port_Number).OwningProcess |
tasklist /fi "pid eq <PID>" |
First, create a function that can be used to execute processes in the background
function bg() {Start-Process -NoNewWindow @args} |
Now it can be used as follows
bg ipconfig /all |
ipconfig will now run in the background