You've already forked SharedScripts
mirror of
https://github.com/jaapbrasser/SharedScripts.git
synced 2025-12-24 21:51:38 +02:00
Added better string validation
This commit is contained in:
@@ -228,7 +228,7 @@ Will retrieve list of programs from the local system, while also retrieving Micr
|
||||
}
|
||||
if ($LastAccessTime) {
|
||||
$InstallPath = ($RegBase.OpenSubKey("$CurrentReg$_")).GetValue('InstallLocation') -replace '\\$',''
|
||||
if ($InstallPath) {
|
||||
if (-not [string]::IsNullOrEmpty($InstallPath)) {
|
||||
$WmiSplat = @{
|
||||
ComputerName = $Computer
|
||||
Query = $("ASSOCIATORS OF {Win32_Directory.Name='$InstallPath'} Where ResultClass = CIM_DataFile")
|
||||
|
||||
Reference in New Issue
Block a user