Hi I have a requirement to disable NIC using powershell remotely. I'm using below command. It works when i hardcode NIC's Name in the command but it is failing when i pass the NIC's Name in variable. Working Fine: [code="other"]Invoke-Command -Computer MYREMOTESERVER {(Disable-NetAdapter –Name "Trunk1" –Confirm:$false)}[/code]Failing: [code="sql"]Invoke-Command -Computer MYREMOTESERVER {(Disable-NetAdapter –Name $NICName –Confirm:$false)}[/code]
↧