Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Functions #2102

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions functions/private/Get-LocalizedYesNo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,60 +27,6 @@ function Get-LocalizedYesNo {
$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
}


function Get-LocalizedYesNoTakeown {
<#
.SYNOPSIS
This function runs takeown.exe and captures its output to extract yes no in a localized Windows

.DESCRIPTION
The function retrieves lines from the output of takeown.exe until there are at least 2 characters
captured in a specific format, such as "Yes=<first character>, No=<second character>".

.EXAMPLE
$yesNoArray = Get-LocalizedYesNo
Write-Host "Yes=$($yesNoArray[0]), No=$($yesNoArray[1])"
#>

# Run takeown.exe and capture its output
$takeownOutput = & takeown.exe /? | Out-String

# Parse the output and retrieve lines until there are at least 2 characters in the array
$found = $false
$charactersArray = @()
foreach ($line in $takeownOutput -split "`r`n")
{
# skip everything before /D flag help
if ($found)
{
# now that /D is found start looking for a single character in double quotes
# in help text there is another string in double quotes but it is not a single character
$regexPattern = '"([a-zA-Z])"'

$charactersArray = [regex]::Matches($line, $regexPattern) | ForEach-Object { $_.Groups[1].Value }

# if ($charactersArray.Count -gt 0) {
# Write-Output "Extracted symbols: $($matches -join ', ')"
# } else {
# Write-Output "No matches found."
# }

if ($charactersArray.Count -ge 2)
{
break
}
}
elseif ($line -match "/D ")
{
$found = $true
}
}

Write-Debug "According to takeown.exe local Yes is $charactersArray[0]"
# Return the array of characters
return $charactersArray
Expand Down
16 changes: 0 additions & 16 deletions functions/private/Invoke-MicroWin-Helper.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
function Invoke-MicroWin-Helper {
<#

.SYNOPSIS
checking unit tests

.PARAMETER Name
no parameters

.EXAMPLE
placeholder

#>

}

function Test-CompatibleImage() {
<#

Expand Down