mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-05 06:37:26 +00:00
Deleted unused functions (#4482)
* Delete functions/private/Get-LocalizedYesNo.ps1 * Delete functions/private/Get-WPFObjectName.ps1 * Merge branch 'main' into patch-4
This commit is contained in:
@@ -1,34 +0,0 @@
|
|||||||
function Get-LocalizedYesNo {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
This function runs choice.exe and captures its output to extract yes no in a localized Windows
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
The function retrieves the output of the command 'cmd /c "choice <nul 2>nul"' and converts the default output for Yes and No
|
|
||||||
in the localized format, such as "Yes=<first character>, No=<second character>".
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
$yesNoArray = Get-LocalizedYesNo
|
|
||||||
Write-Host "Yes=$($yesNoArray[0]), No=$($yesNoArray[1])"
|
|
||||||
#>
|
|
||||||
|
|
||||||
# Run choice and capture its options as output
|
|
||||||
# The output shows the options for Yes and No as "[Y,N]?" in the (partially) localized format.
|
|
||||||
# eg. English: [Y,N]?
|
|
||||||
# Dutch: [Y,N]?
|
|
||||||
# German: [J,N]?
|
|
||||||
# French: [O,N]?
|
|
||||||
# Spanish: [S,N]?
|
|
||||||
# Italian: [S,N]?
|
|
||||||
# Russian: [Y,N]?
|
|
||||||
|
|
||||||
$line = cmd /c "choice <nul 2>nul"
|
|
||||||
$charactersArray = @()
|
|
||||||
$regexPattern = '([a-zA-Z])'
|
|
||||||
$charactersArray = [regex]::Matches($line, $regexPattern) | ForEach-Object { $_.Groups[1].Value }
|
|
||||||
|
|
||||||
Write-Debug "According to takeown.exe local Yes is $charactersArray[0]"
|
|
||||||
# Return the array of characters
|
|
||||||
return $charactersArray
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
function Get-WPFObjectName {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
This is a helper function that generates an objectname with the prefix WPF that can be used as a Powershell Variable after compilation.
|
|
||||||
To achieve this, all characters that are not a-z, A-Z or 0-9 are simply removed from the name.
|
|
||||||
|
|
||||||
.PARAMETER type
|
|
||||||
The type of object for which the name should be generated. (e.g. Label, Button, CheckBox...)
|
|
||||||
|
|
||||||
.PARAMETER name
|
|
||||||
The name or description to be used for the object. (invalid characters are removed)
|
|
||||||
|
|
||||||
.OUTPUTS
|
|
||||||
A string that can be used as a object/variable name in powershell.
|
|
||||||
For example: WPFLabelMicrosoftTools
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Get-WPFObjectName -type Label -name "Microsoft Tools"
|
|
||||||
#>
|
|
||||||
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory, position=0)]
|
|
||||||
[string]$type,
|
|
||||||
|
|
||||||
[Parameter(position=1)]
|
|
||||||
[string]$name
|
|
||||||
)
|
|
||||||
|
|
||||||
$Output = $("WPF"+$type+$name) -replace '[^a-zA-Z0-9]', ''
|
|
||||||
return $Output
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user