Closed glaisne closed 5 years ago
@glaisne what version of poshspec are you using?
I did not do a very good code review on this function. It has a number of issues and the whole thing should be redesigned. If anyone would like to take a stab at it, that would be great. Otherwise, I'll try to get to it shortly.
Issues:
Exist
assertion only works if you pass a Path to it. It's not functional with the currently designed $expression
.Exists
just calls Test-Path
which does support string[]
for -Path
, but I haven't tested if Exist
supports that. Either we need to test both Windows and WOW6432Node paths, or create a seperate function for SoftwareProduct32 to look in the 32bit path.I'm using 2.2.1. Accrding to repositorySourceLocation, I pulled it from powershellGallery.com. My PS version is 5.1.15063.296, CLR is 4.0.30319.42000.
Hi,
I encounter the same issue with:
PSVersion 5.1.17134.407
PSEdition Desktop
BuildVersion 10.0.17134.407
CLRVersion 4.0.30319.42000Script poshspec Version 2.2.2
@cdhunt, given that -Exists
feels more natural (even though it is specific to paths), I wonder if it would make sense to dynamically swap -Exists
with -Not -NullOrEmpty
within SoftwareProduct
before calling Get-PoshspecParam
. What do you think?
@cdhunt, @markwragg is there a chance that you could publish a new version with this fix to the PSGallery?
I can't currently publish new versions but Chris is going to give me access to do so will do after that.
Fixed as of version 2.2.8 which has just been published to the gallery.
Yay!!! Thanks a ton, @markwragg
I get a 'Path[0]:' prompt when using SoftwareProduct for Test-Path. Somehow the $_ in the Test-Path scriptblock is getting lost somewhere in lines 81-82 on get-PoshspecParam.ps1.
I'm getting this error on the same system running PS 5.1 in vscode and the regular host.