I try to retreive a pass and put it in a file.
The file can only contain that pass, but Out-File adds a carriage return for some reason.
I expect the file to only have one line and no carriage return after the password:
function Save-ArgoCDInitialPassword {
$output = argocd admin initial-password -n argocd
$password = $output | Where-Object { $_.Trim() -ne "" } | Select-Object -First 1
$password = $password.Trim()
$filePath = Join-Path -Path $PSScriptRoot -ChildPath "argocd_password.txt"
$password | Out-File -FilePath $filePath -Encoding ascii
}
