From the error message it looks as if the variable $vm holds a $null value.
It looks as if your input contains a VmName of the VM that is not present in the environment to which you are connected
From the error message it looks as if the variable $vm holds a $null value.
It looks as if your input contains a VmName of the VM that is not present in the environment to which you are connected