Can I run this as a parameter?
$Switch = if ((Get-VMSwitch).Name.count -gt 1) {(Get-VMSwitch).Name -notmatch "SCSI" | select -First 1} else {(Get-VMSwitch).name}
It seems to work on the command line but I can't run it as a parameter. This is for Hyper-V on Windows 2012 with Powershell v3. If I can't run that as a parameter, any alternatives? Thanks!