This commit is contained in:
Mikael Karlsson
2023-01-26 22:29:21 +11:00
parent 897309e48e
commit ece28a649f
41 changed files with 6475 additions and 1894 deletions

View File

@@ -11,7 +11,7 @@ This module handles the WPF UI
function Get-ModuleVersion
{
'3.7.1'
'3.8.1'
}
function Initialize-Window
@@ -415,7 +415,7 @@ function Set-XamlProperty
function Get-XamlProperty
{
param($xamlObj, $controlName, $propertyName, $defaultValue)
param($xamlObj, $controlName, $propertyName, $defaultValue = $null)
$obj = $xamlObj.FindName($controlName)
@@ -423,7 +423,7 @@ function Get-XamlProperty
{
if($obj)
{
return (?? $obj."$propertyName" $null)
return (?? $obj."$propertyName" $defaultValue)
}
else
{
@@ -2666,6 +2666,34 @@ function Show-LogView
}
}
function Get-Base64ScriptContent
{
param($encodeContent, [switch]$RemoveSignature)
if(-not $encodeContent) { return }
try
{
$scriptContent = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encodeContent))
if($RemoveSignature -eq $true)
{
$x = $scriptContent.IndexOf("# SIG # Begin signature block")
if($x -gt 0)
{
$scriptContent = $scriptContent.SubString(0,$x)
$scriptContent = $scriptContent + "# SIG # Begin signature block`nSignature data excluded..."
}
}
$scriptContent
}
catch
{
}
}
New-Alias -Name ?? -value Invoke-Coalesce
New-Alias -Name ?: -value Invoke-IfTrue
Export-ModuleMember -alias * -function *