Files
winutil/functions/private/Get-WinUtilVariables.ps1
T

30 lines
771 B
PowerShell
Raw Normal View History

+2
2023-05-09 13:14:27 -05:00
function Get-WinUtilVariables {
<#
2023-10-19 17:12:55 -05:00
.SYNOPSIS
Gets every form object of the provided type
.OUTPUTS
List containing every object that matches the provided type
+2
2023-05-09 13:14:27 -05:00
#>
param (
[Parameter()]
2024-01-12 00:34:41 -06:00
[string[]]$Type
+2
2023-05-09 13:14:27 -05:00
)
$keys = ($sync.keys).where{ $_ -like "WPF*" }
2024-01-12 00:34:41 -06:00
if ($Type) {
+2
2023-05-09 13:14:27 -05:00
$output = $keys | ForEach-Object {
try {
2024-01-12 00:34:41 -06:00
$objType = $sync["$psitem"].GetType().Name
if ($Type -contains $objType) {
+2
2023-05-09 13:14:27 -05:00
Write-Output $psitem
}
} catch {
2024-01-12 00:34:41 -06:00
<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>
}
+2
2023-05-09 13:14:27 -05:00
}
2023-10-19 17:12:55 -05:00
return $output
+2
2023-05-09 13:14:27 -05:00
}
return $keys
}