Management (processes)
- Commands
- Set-Location – Sets the current working location to a specified location
- Push-Location – Adds the current location to the top of a location stack
- Pop-Location – Changes the current location to the location most recently pushed onto the stack
- Get-ChildItem – Gets the items and child items in one or more specified locations
- Get-ComputerInfo – Gets a consolidated object of system and operating system properties
- Get-PSDrive – Gets drives in the current session
- Get-Process – Gets the processes that are running on the local computer
- Stop-Process – Stops one or more running processes
- Rename-Computer – Renames a computer
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management
Commands
Set-Location – Sets the current working location to a specified location
Set-Location -Path $Env:SystemRoot
PS C:\Windows> Set-Location -Path Cert: PS Cert:\> Set-Location -Path HKLM: PS HKLM:\>
# Navigate back through the history using "-"
PS HKLM:\> Set-Location -Path -
PS Cert:\> Set-Location -Path -
PS C:\Windows>
# Navigate using the Set-Location alias "cd" and the implicit positional Path parameter
PS C:\Windows> cd -
cd +
PS C:\Windows> cd +
PS Cert:\>
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-location
Push-Location – Adds the current location to the top of a location stack
PS C:\> Push-Location C:\Windows
Pop-Location – Changes the current location to the location most recently pushed onto the stack
PS C:\> Pop-Location
Get-ChildItem – Gets the items and child items in one or more specified locations
Get-ChildItem -Path HKLM:\HARDWARE
Get-ChildItem -Path C:\Parent -Depth 2
Alias: gci
gci env:* | sort-object name
Get-ComputerInfo – Gets a consolidated object of system and operating system properties
Get-ComputerInfo -Property "*version"
Get-PSDrive – Gets drives in the current session
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-psdrive
Get-PSDrive
Get-Process – Gets the processes that are running on the local computer
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process
Get-Process -IncludeUserName deadlinemonitor
Stop-Process – Stops one or more running processes
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-process
Get-Process -IncludeUserName deadlinemonitor | Stop-Process -Force
Rename-Computer – Renames a computer
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer
The Force parameter suppresses the confirmation prompt.
Rename-Computer -ComputerName "Srv01" -NewName "Server001" -DomainCredential Admin01@domain.lan -Force -Restart
Not need to leave and rejoin the domain or anything like that.