Рет қаралды 33,363
If you're a PowerShell user, then you likely have a handful of commands you use on a regular basis. Among the hundreds of cmdlets, there are likely a few useful ones that you're unaware of. Join Mike in this video as he shares his top 5 PowerShell commands!
Looking for PowerShell training? Start learning today with ITProTV: go.itpro.tv/courses-all
00:00 Intro
01:09 #1: Test-Path
05:50 #2: Get-ExecutionPolicy
08:22 #3: Get-Credential
10:58 #4: Invoke-Command
15:20 #5: Enter-PSSession
Commands used in video:
Test-Path “c:\test.txt”
Test-Path “c:\test2.txt”
New-Item -ItemType File “c:\test.txt”
If (!(Test-Path “c:\test.txt”)){ New-Item -ItemType File “c:\test.txt” }
Test-Path -Path "HKLM:\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell"
Test-Path $pshome\pwsh.exe -NewerThan "July 24, 2019"
Get-ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolicy
$creds = Get-Credential
Invoke-Command -ComputerName svr01 -Credential $creds -ScriptBlock { Get-ExecutionPolicy}
Invoke-Command -ComputerName svr01 -Credential $creds -FilePath “e:\scripts\demo.ps1”
Enter-PSSession
Exit-PSSession
#toppowershellcommands #usefulpowershellcommands #bestpowershellcmdlets