any idea why this is not working
$esxhosts = get-vmhost -name (get-content esxhosts.txt)
#$root_pass = read-host -Prompt "Enter root PAssword"
$root_pass = Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File encryptedpassword.txt
$encrypted = ConvertTo-SecureString(Get-Content ".\encryptedpassword.txt")
$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($encrypted)
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
$cmd1 = '/etc/init.d/slpd stop'
foreach ($vmhost in $esxhosts) {
echo y | plink.exe $vmhost -pw $password -l root $cmd1 -batch
}
I keep getting this kind of prompt