Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Here is one of the most helpful code snippets that I have come up with using PowerShell Direct:
function waitForPSDirect([string]$VMName, $cred){
Write-Output "[$($VMName)]:: Waiting for PowerShell Direct (using $($cred.username))"
while ((icm -VMName $VMName -Credential $cred {"Test"} -ea SilentlyContinue) -ne "Test") {Sleep -Seconds 1}}
In essence this function allows you to block your script until the requested virtual machine has booted and is responding to PowerShell Direct. This is immensely useful when you are provisioning virtual machine and need to know when the guest operating system is actually up and running - and has become a staple function in many of my scripts.
Cheers,
Ben