Post Detail

April 10, 2025 in Tools, Tutorials

100 Essential PowerShell Commands for Windows 10 & 11 (2025 Edition)

πŸ–₯️ System Information & Performance

  1. Get-ComputerInfo β€” Displays detailed system information.
  2. Get-Process β€” Lists all running processes.
  3. Get-Service β€” Shows all services and their current status.
  4. Get-WmiObject win32_bios β€” Returns BIOS version and related info.
  5. Get-WmiObject Win32_ComputerSystem β€” Displays system model, manufacturer, and domain.
  6. Get-CimInstance -ClassName Win32_OperatingSystem β€” Shows OS version and build info.
  7. Get-HotFix β€” Lists installed Windows updates.
  8. systeminfo β€” Displays full system details including install date, RAM, and domain.
  9. Get-EventLog -LogName System -Newest 50 β€” Shows the 50 most recent system event logs.
  10. Get-ItemProperty “HKLM:\Software\Microsoft\Windows NT\CurrentVersion” β€” Displays Windows version from the registry.
  11. Get-Host β€” Displays information about the PowerShell host environment.
  12. Get-Uptime β€” Shows how long the system has been running.
  13. Get-EventLog -List β€” Lists all available event logs.
  14. Clear-EventLog -LogName Application β€” Clears the Application event log.
  15. Get-PSDrive β€” Lists logical drives, including registry and environment.
  16. Get-Location β€” Displays the current working directory.
  17. Measure-Command { Get-Process } β€” Measures how long a command takes to run.
  18. Get-History β€” Displays session command history.
  19. Clear-History β€” Clears command history from the current session.
  20. Get-LogProperties β€” Displays log configuration properties for a source.

πŸ” User & Security Management

  1. Get-LocalUser β€” Lists all local user accounts.
  2. New-LocalUser -Name “testuser” -Password (Read-Host -AsSecureString) β€” Creates a new local user.
  3. Add-LocalGroupMember -Group “Administrators” -Member “testuser” β€” Adds a user to the Administrators group.
  4. Remove-LocalUser -Name “testuser” β€” Deletes the specified user.
  5. Set-LocalUser -Name “testuser” -PasswordNeverExpires $true β€” Prevents the user’s password from expiring.
  6. Get-LocalGroup β€” Lists all local groups on the machine.
  7. Get-LocalGroupMember -Group “Administrators” β€” Lists members of the Administrators group.
  8. Enable-LocalUser -Name “Guest” β€” Enables the Guest account.
  9. Disable-LocalUser -Name “Guest” β€” Disables the Guest account.
  10. net user β€” Lists all users on the system using classic CMD.

πŸ“¦ Software & Applications

  1. Get-Package β€” Lists all installed software packages.
  2. Get-AppxPackage β€” Lists installed Microsoft Store apps.
  3. Get-AppxPackage -AllUsers β€” Lists apps for all user profiles.
  4. Remove-AppxPackage -Package “Microsoft.YourPhone” β€” Removes the Your Phone app.
  5. Install-PackageProvider -Name NuGet -Force β€” Installs NuGet for module management.
  6. Get-WmiObject -Class Win32_Product β€” Lists all installed applications (slow but detailed).
  7. winget list β€” Lists all installed software using Winget.
  8. winget install firefox β€” Installs Firefox via Windows Package Manager.
  9. Get-PackageSource β€” Lists registered software repositories.
  10. Update-Module β€” Updates all installed PowerShell modules.

πŸ“ File & Folder Management

  1. Get-ChildItem β€” Lists files and folders in the current directory.
  2. Get-ChildItem -Recurse β€” Lists all files and folders recursively.
  3. Copy-Item -Path “C:\Source” -Destination “D:\Backup” -Recurse β€” Copies folders recursively.
  4. Move-Item -Path “file.txt” -Destination “C:\NewFolder” β€” Moves a file.
  5. Remove-Item -Path “C:\Temp\oldfile.txt” β€” Deletes a file.
  6. New-Item -ItemType Directory -Path “C:\Reports” β€” Creates a new folder.
  7. Get-Content C:\file.txt β€” Displays contents of a file.
  8. Set-Content C:\file.txt “Hello World” β€” Replaces file content with new text.
  9. Add-Content C:\file.txt “New Line” β€” Appends text to a file.
  10. Get-FileHash C:\file.txt β€” Generates a hash of a file.

🌐 Networking

  1. Test-Connection google.com β€” Pings a host and displays response time.
  2. Resolve-DnsName example.com β€” Resolves a domain name to IP.
  3. Get-NetIPAddress β€” Shows all configured IP addresses.
  4. Get-NetAdapter β€” Lists all network adapters.
  5. Get-NetTCPConnection β€” Displays active TCP connections.
  6. Get-NetFirewallProfile β€” Shows firewall status for domain/private/public.
  7. Get-NetRoute β€” Displays the routing table.
  8. Get-NetIPConfiguration β€” Displays full IP config.
  9. Set-DnsClientServerAddress -InterfaceAlias “Ethernet” -ServerAddresses “8.8.8.8”,”1.1.1.1″ β€” Sets DNS servers.
  10. ipconfig /all β€” Displays full network configuration (legacy).

πŸ“… Tasks & Services

  1. Get-ScheduledTask β€” Lists all scheduled tasks.
  2. Register-ScheduledTask β€” Creates a new scheduled task.
  3. Unregister-ScheduledTask β€” Deletes a scheduled task.
  4. Start-ScheduledTask -TaskName “Cleanup” β€” Manually runs a scheduled task.
  5. Get-Service bits β€” Displays the status of the BITS service.
  6. Start-Service wuauserv β€” Starts the Windows Update service.
  7. Stop-Service wuauserv β€” Stops the Windows Update service.
  8. Restart-Service spooler β€” Restarts the Print Spooler service.
  9. Set-Service -Name bits -StartupType Manual β€” Changes the service startup type.
  10. sc query β€” Shows service status using classic command-line.

🧰 Clipboard, Registry & Utilities

  1. Get-Clipboard β€” Retrieves clipboard contents.
  2. Set-Clipboard -Value “Copied text” β€” Sets clipboard contents.
  3. New-Item -Path “HKCU:\Software\Test” -Force β€” Creates a registry key.
  4. Remove-Item -Path “HKCU:\Software\Test” -Recurse β€” Deletes a registry key.
  5. Get-ItemProperty -Path “HKCU:\Software\Test” β€” Displays registry key properties.
  6. Set-ItemProperty -Path “HKCU:\Software\Test” -Name “Setting” -Value “123” β€” Sets a registry value.
  7. Get-Variable β€” Lists all PowerShell variables in the session.
  8. Clear-Variable -Name “varName” β€” Clears the specified variable.
  9. Get-Alias β€” Lists all aliases for PowerShell commands.
  10. New-Alias -Name list -Value Get-ChildItem β€” Creates a command shortcut.

πŸ”„ Automation, Scripting & Loops

  1. For ($i = 1; $i -le 5; $i++) { Write-Output “Line $i” } β€” Loops and prints 5 lines.
  2. $files = Get-ChildItem C:\Logs β€” Stores files in a variable.
  3. foreach ($file in $files) { Write-Output $file.Name } β€” Loops through a file list.
  4. if (Test-Path C:\temp.txt) { Remove-Item C:\temp.txt } β€” Deletes a file if it exists.
  5. Try { Get-Item C:\missing.txt } Catch { Write-Output “Error!” } β€” Try/catch for errors.
  6. Start-Sleep -Seconds 5 β€” Pauses the script for 5 seconds.
  7. Read-Host “Enter your name” β€” Prompts user input.
  8. Write-Output “Hello, world” β€” Outputs text to the console.
  9. Out-File -FilePath C:\log.txt β€” Saves output to a text file.
  10. Get-Command β€” Lists all available commands in PowerShell.

πŸ§ͺ Troubleshooting & Diagnostics

  1. Get-WindowsUpdateLog β€” Collects and converts the Windows Update log.
  2. sfc /scannow β€” Scans for and repairs corrupted system files.
  3. DISM /Online /Cleanup-Image /RestoreHealth β€” Repairs Windows image files.
  4. Get-EventLog -LogName Application -Newest 20 β€” Shows the latest application logs.
  5. Get-EventLog -LogName Security -EntryType FailureAudit β€” Filters failed login attempts.
  6. ping 8.8.8.8 β€” Tests basic internet connectivity.
  7. tracert google.com β€” Traces the path to a host.
  8. Get-Content “C:\Windows\Logs\CBS\CBS.log” -Tail 50 β€” Shows the latest lines from the CBS log.
  9. Get-WindowsErrorReporting β€” Displays Windows error reporting configuration.
  10. Get-Disk β€” Lists all connected disks and partitions.

Conclusion:
This list of 100 PowerShell commands will help you navigate the Windows operating system like a pro. From managing users to automating tasks and digging into diagnostics, these commands are essential for anyone serious about mastering Windows with PowerShell.




By browsing this website, you agree to our privacy policy.
I Agree