toggle
This commit is contained in:
20
Notes.md
20
Notes.md
@ -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
|
||||
```
|
Reference in New Issue
Block a user