Hello
I've written a script to run a bunch of tests against our various vCloud Director sites. It works fine on the box I was developing it on (which runs Powershell 3 / PowerCLI 5.1 R1). When I've moved it to another machine (running Powershell 4 / PowerCLI 5.8) it starts behaving a bit strange.
For instance, I've taken to shortcutting my commands like this:
$Orgvdc = Get-OrgVDC "My First Org VDC"
This works fine on the box running Powershell3/PowerCLI5.1 box but if I run the same on my Powershell4/PowerCLI5.8 box I get the following error:
Get-OrgVdc OrgVdc with name 'My First Org VDC' was not found using the specified filter(s).
It only seems to work on PS4/PCLI5.8 if I do it this way:
$Orgvdc = Get-OrgVDC | where {$_.name -eq "My First Org VDC"}
Does anyone know if something has changed in Powershell 4 or PowerCLI 5.8 that has stopped us from being lazy and doing it the short method?
EDIT: Just realised that it seems to work if I have no spaces in the name. So Get-OrgVDC "MyOrgVDC" works (if there is one with that name) but Get-OrgVDC "My Org VDC" appears not to work - returning a " "My Org VDC" was not found using the specified filters" error. So a problem with spaces then?
Dave
For the record, PowerCLI 6.0 with Powershell 4.0 solved my problem and filters work correctly on vCloud Director cmdlets from the PowerShell ISE which is nice
Dave
Thread moved to the vCloud Director PowerCLI community.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I found another post covering the same issue. It seems that there is a bug that messes with filters work with vCloud Director cmdlets - but it's only an issue within the Powershell ISE. I didn't mention I was using the ISE as I didn't think it made any difference. However, I've now tried running the script on the Powershell 4 / PowerCLI 5.8 machine within a normal Powershell console and it works fine.
So for the moment I'll continue to develop my scripts on a box running Powershell 3 / PowerCLI 5.1 and move the finished scripts to the other box once they're completed.
Maybe I should try PowerCLI 6 and see if it's resolved in that.
Dave
For the record, PowerCLI 6.0 with Powershell 4.0 solved my problem and filters work correctly on vCloud Director cmdlets from the PowerShell ISE which is nice
Dave