Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Stop-VM via Powershell

$
0
0

Hallo zusammen,

ich habe folgendes Phänomen:

$VMnames = get-vm |select-object VMElementName
$VMNames |out-file "C:\Windows\Scripts\VMs.log"
$VMs = get-content -path "C:\Windows\Scripts\VMs.log"
Foreach ($VMname in $VMs)
{
write-output "Reboot VM $VMname" |Out-File "C:\Windows\Scripts\Reboot.log" -Append
Get-Date |Out-File "C:\Windows\Scripts\Reboot.log" -Append
Stop-VM $VMname –Force
}

funktioniert so leider nicht. Wenn ich auch noch Stop-VM -Name $VMname -Force probiere geht es schonmal garnicht.

Versuche ich aber nur Stop-VM "name" -force funktioniert alles.

Grüße


ooGDoo


Viewing all articles
Browse latest Browse all 2314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>