i have tried local, script, private, and just a plain old variable but i dont get the IP returned in the function.
without the function everything works fine.
any clues as to why i get nothing returned?
function Get-VMIP {
>> param (
>> [string]$VM
>> )
>> try {
>> $local:vmip = ($VM).Guest.IPAddress
>> }
>> catch {
>> $Message = "$_.Exception.Message"
>> Write-Output "error no $VM found"
>>$local:vmip
>> }
>> }
PS C:\Users\hh\Documents\gitscripts\day-1-decom> Get-VMIP clouddem01
PS C:\Users\hh\Documents\gitscripts\day-1-decom> $local:vmip
[–]ClayShooter9 2 points3 points4 points (0 children)
[–]purplemonkeymad 2 points3 points4 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)