mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 17:30:37 -06:00
30 lines
771 B
PowerShell
30 lines
771 B
PowerShell
function Get-WinUtilVariables {
|
|
|
|
<#
|
|
.SYNOPSIS
|
|
Gets every form object of the provided type
|
|
|
|
.OUTPUTS
|
|
List containing every object that matches the provided type
|
|
#>
|
|
param (
|
|
[Parameter()]
|
|
[string[]]$Type
|
|
)
|
|
$keys = ($sync.keys).where{ $_ -like "WPF*" }
|
|
if ($Type) {
|
|
$output = $keys | ForEach-Object {
|
|
try {
|
|
$objType = $sync["$psitem"].GetType().Name
|
|
if ($Type -contains $objType) {
|
|
Write-Output $psitem
|
|
}
|
|
} catch {
|
|
<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>
|
|
}
|
|
}
|
|
return $output
|
|
}
|
|
return $keys
|
|
}
|