-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathps-cheat-sheet.ps1
31 lines (21 loc) · 1.29 KB
/
ps-cheat-sheet.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Clear-Host
Write-Host "Get-Alias dir, cls" -ForegroundColor Green
Get-Alias dir, cls
Write-Host "Get-Command -Name get-* -Module NullKit" -ForegroundColor Green
Get-Command -Name get-* -Module NullKit
Write-Host "Get-Command -Module NullKit" -ForegroundColor Green
Get-Command -Module NullKit
Write-Host "Get-Command | Group-Object Verb | Sort-Object Count -Descending" -ForegroundColor Green
Get-Command | Group-Object Verb | Sort-Object Count -Descending
Write-Host "Get-Command | Group-Object Noun | Sort-Object Name" -ForegroundColor Green
Get-Command | Group-Object Noun | Sort-Object Name | Sort-Object Count -Descending | Select-Object -First 10
Get-Service | Sort-Object -Property @{expression = 'Status'; descending = $true }, @{expression = 'DisplayName'; descending = $false }
Write-Host "[System.DateTime] | Get-Member -MemberType Method Get*" -ForegroundColor Green
[System.DateTime] | Get-Member -MemberType Method Get*
Write-Host Get-ItemProperty -ForegroundColor Green
Get-Item "C:\Windows\System32\drivers\etc\hosts" | Get-ItemProperty | Format-List -Property *
Write-Host "Get-Module -ListAvailable" -ForegroundColor Green
Get-Module -ListAvailable
Write-Host Get-WindowsOptionalFeature -ForegroundColor Green
Get-WindowsOptionalFeature -Online -FeatureName *iis*
#Enable-WindowsOptionalFeature