Quantcast
Channel: PowerShell App Deployment Toolkit
Viewing all articles
Browse latest Browse all 2341

Commented Unassigned: Using wildcard with get-installedApplications [130]

$
0
0
Hi,

I am testing some scenarios with get-applications:

In the registry, I created Vcredist2005_Frv2

```
Get-InstalledApplication -Name "^Vcredist2005_Frv[1-9]$"
```
And it found nothing. I need finding installed applications by using someking of wildcards.

Some situations:

1. Vcredist2005_Frv2 --> Finding a value with different V value (v1, v2 and so on)
2. Vcredist2005_Frv1 - basis --> Comparing full string. In this example and need comparing it with Vcredist2005_Frv1 and then the result should be false as the strings are different.

From the powershell, if I run then it is working:
```

"Vcredist2005_Frv2" -match "^Vcredist2005_Frv[1-9]$" but this is returning $True.
```

```
"Vcredist2005_Frv1 - basis" -match "^Vcredist2005_Frv[1-9]$" this would return $False and it is correct as the values are different.
```

In your code, you are doing __($regKeyApp.DisplayName -match [regex]::Escape($application) __this is preventing my search working as it is adding a lot of \

1. Would it be better using -like instead of -match
2. Is it possible to run my search with get-applications?
3. Is it a bug?

Thanks,


Thanks,

François

Comments: Hi, In the registry: DisplayName: Vcredist2005_Frv2 - test Get-InstalledApplication -Name "Vcredist2005_Frv", then it is finding the DisplayName. This is incorrect as the string is different. Get-InstalledApplication -Name "Vcredist2005_Frv*" would be correct to identify the whole string Get-InstalledApplication -Name "Vcredist2005_Frv?" should only identify "Vcredist2005_Frv1" "Vcredist2005_Frv2" and so on. So this is a problem as your function is making search as * and never as ? Thanks, François

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>