This commit is contained in:
ofilter
2022-04-05 23:27:54 +02:00
parent 393d025b14
commit 1a72313e20
2 changed files with 24 additions and 6 deletions

View File

@ -109,6 +109,12 @@ Write-Output "text"
Write-Output "text" | Select-String -pattern $filters -notMatch
```
### Select-Object
```ps
Select-Object HostName
```
## File interactions
### Read file
@ -158,6 +164,8 @@ Invoke-Command -ComputerName hostname1, hostname2 -ScroptBlock {$COMMAND}
### ?
https://devblogs.microsoft.com/scripting/understanding-powershell-and-basic-string-formatting/
https://adamtheautomator.com/hyper-v-powershell/
## Objects
### Functions
@ -181,4 +189,14 @@ New-VM -Name "HYPER" -MemoryStartupBytes 512MB
```
### List current VM
Get-VM
```ps
Get-VMHost
[[-ComputerName] <String[]>]
[[-Credential] <PSCredential[]>]
[<CommonParameters>]
```
#### Example
##### Find VM by name
```ps
Get-VM -ComputerName Server1
```