1. Direct – Using the environment path or local folder
Example:
1 |
netstat -ano |
2. Invoke-Expression (IEX)
Example:
1 2 |
$str = "Get-Process" Invoke-Expression $str |
3. Invoke-Command (ICM)
Example:
1 2 |
$scriptblock = {ping host3} Invoke-Command -scriptblock $scriptblock -computername "host1","host2" |
4. Invoke-Item
Example:
1 2 |
#opens all TXTs in the current directory Invoke-Item *.txt |