# Essential Windows 11 PowerShell Commands Reference # Educational PowerShell Scripts # Date: May 21, 2025 # SYSTEM INFORMATION COMMANDS # -------------------------- # Get Windows version information Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer # Get hardware information Get-CimInstance -ClassName Win32_ComputerSystem Get-CimInstance -ClassName Win32_Processor Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum # Get disk information Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DriveType=3" # Get network adapter information Get-NetAdapter Get-NetIPAddress # Get installed software Get-CimInstance -ClassName Win32_Product | Select-Object Name, Version # See all environment variables Get-ChildItem Env: # FILE SYSTEM COMMANDS # ------------------- # Navigate directories Set-Location -Path C:\Path\To\Directory # cd equivalent Get-Location # pwd equivalent # List files and folders Get-ChildItem # ls/dir equivalent Get-ChildItem -Path C:\Windows -Filter *.exe -Recurse -File # File operations New-Item -Path "C:\path\newfile.txt" -ItemType File New-Item -Path "C:\path\newfolder" -ItemType Directory Copy-Item -Path "C:\source\file.txt" -Destination "C:\dest\file.txt" Move-Item -Path "C:\source\file.txt" -Destination "C:\dest\file.txt" Remove-Item -Path "C:\path\file.txt" Remove-Item -Path "C:\path\folder" -Recurse # Get file content Get-Content -Path "C:\path\file.txt" Select-String -Path "C:\path\file.txt" -Pattern "search term" # PROCESS MANAGEMENT # ----------------- # View all running processes Get-Process # Get specific process Get-Process -Name "chrome" # Start a process Start-Process -FilePath "notepad.exe" Start-Process -FilePath "notepad.exe" -ArgumentList "C:\path\file.txt" # Stop a process Stop-Process -Name "notepad" Stop-Process -Id 1234 Stop-Process -Name "notepad" -Force # SERVICE MANAGEMENT # ----------------- # List all services Get-Service # Get specific service status Get-Service -Name "wuauserv" # Windows Update service # Start, stop, restart services Start-Service -Name "wuauserv" Stop-Service -Name "wuauserv" Restart-Service -Name "wuauserv" # USER MANAGEMENT # -------------- # Get local users Get-LocalUser # Create new local user New-LocalUser -Name "username" -Description "Description" -NoPassword # Set user password $Password = Read-Host -AsSecureString Set-LocalUser -Name "username" -Password $Password # Add user to group Add-LocalGroupMember -Group "Administrators" -Member "username" # REGISTRY MANAGEMENT # ------------------ # Navigate registry Set-Location -Path "HKLM:\SOFTWARE\Microsoft\Windows" # Get registry values Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion" # Set registry value Set-ItemProperty -Path "HKCU:\Software\MyApp" -Name "Setting" -Value "Value" # Create registry key New-Item -Path "HKCU:\Software\MyApp" # NETWORKING COMMANDS # ----------------- # Test network connection Test-NetConnection -ComputerName "www.google.com" Test-NetConnection -ComputerName "www.google.com" -Port 443 # Get IP configuration Get-NetIPConfiguration # Release/Renew DHCP Invoke-Command {ipconfig /release} Invoke-Command {ipconfig /renew} # Flush DNS Invoke-Command {ipconfig /flushdns} # WINDOWS FEATURES # -------------- # View all Windows features Get-WindowsOptionalFeature -Online # Enable/Disable Windows features Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" Disable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol" # WINDOWS UPDATES # ------------- # Check for Windows updates Install-Module PSWindowsUpdate Get-WindowsUpdate # Install Windows updates Install-WindowsUpdate # TASK SCHEDULING # ------------- # View scheduled tasks Get-ScheduledTask # Create a scheduled task $Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\path\script.ps1" $Trigger = New-ScheduledTaskTrigger -Daily -At 9am Register-ScheduledTask -Action $Action -Trigger $Trigger -TaskName "MyTask" -Description "Task description"