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
|
2023-05-09 13:14:27 -05:00
|
|
|
#>
|
|
|
|
|
param (
|
|
|
|
|
[Parameter()]
|
2024-01-12 00:34:41 -06:00
|
|
|
[string[]]$Type
|
2023-05-09 13:14:27 -05:00
|
|
|
)
|
2024-06-29 00:02:32 +02:00
|
|
|
$keys = ($sync.keys).where{ $_ -like "WPF*" }
|
2024-01-12 00:34:41 -06:00
|
|
|
if ($Type) {
|
2023-05-09 13:14:27 -05:00
|
|
|
$output = $keys | ForEach-Object {
|
2024-08-06 23:35:17 +03:00
|
|
|
try {
|
2024-01-12 00:34:41 -06:00
|
|
|
$objType = $sync["$psitem"].GetType().Name
|
|
|
|
|
if ($Type -contains $objType) {
|
2023-05-09 13:14:27 -05:00
|
|
|
Write-Output $psitem
|
|
|
|
|
}
|
2024-08-06 23:35:17 +03:00
|
|
|
} 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#>
|
|
|
|
|
}
|
2023-05-09 13:14:27 -05:00
|
|
|
}
|
2023-10-19 17:12:55 -05:00
|
|
|
return $output
|
2023-05-09 13:14:27 -05:00
|
|
|
}
|
|
|
|
|
return $keys
|
|
|
|
|
}
|