Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.63 KB

windows-powershell.md

File metadata and controls

57 lines (41 loc) · 1.63 KB

Windows Powershell commands

File manipulation

ni / New-Item: Create a new file rm / Remove-Item: Delete a file cp ; Copy-Item: Copy a file mv / Move-Item: Move a file ren / Rename-Item: Rename a file

Directory navigation

  • ls / dir: List current directory
  • cd / chdir: Change directory
  • pushd: Add current path to stack
  • popd: Return to last location on stack

Process management

  • Get-Process: Lists currently running processes.
  • Start-Process: Starts a new process.
  • Stop-Process: Stops a running process.
  • Wait-Process: Waits for a process to exit.

Services

  • gsv List services
  • sasv / Start-Service Start a service
  • spsv / Stop-Service Stop a service
  • Restart-Service Restart aa service

User

  • glu Get-LocalUser
  • nlu New-LocalUser
  • rlu Remove-LocalUser

ACL Permissions

  • Get-Acl: Get access control list (ACL) for a file or resource
  • Set-Acl: Set the ACL for a file or resource

Network commands

  • Test-Connection -ComputerName Test connection to site
  • Get-NetIPAddress Get IP address information
  • Get-NetAdapter List network adapters
  • Resolve-DnsName Resolve hostname to IP address

Processes

  • gps, ps Get-Process List processes
  • start, saps Start-Process -FilePath [filepath] Start a prcoess
  • spps, kill, Stop-Process Stop-Process -Name [name] Kill a process by name

Command history

  • Get-History: List command history