Difference between revisions of "Useful PowerShell Commands"

From rbachwiki
Jump to navigation Jump to search
Line 7: Line 7:
<h3> Write output to the screen, like Echo </h3>
<h3> Write output to the screen, like Echo </h3>
  Write-Output "Hello World"  
  Write-Output "Hello World"  
<h3> Read Text file </h3>
Get-Content filename.txt


  Rename-Computer
  Rename-Computer

Revision as of 20:06, 17 October 2024

Get-ComputerInfo

Accessing the properties of a command

Get-Computerinfo -Properties csusername
Get-Computerinfo -Properties csusername | Get-Member
Get-ComputerInfo | Format-List OsType,osName,csusername

Write output to the screen, like Echo

Write-Output "Hello World" 

Read Text file

Get-Content filename.txt
Rename-Computer
Restart-Computer
Get-Date
Get-TimeZone

Update Windows From PowerShell

Home - Category