Montag, 12. Dezember 2016

Determine the current text encoding of your Windows

$Enc = [System.Text.Encoding]::Default
Write-Host "Encoding name: " $Enc.EncodingName
Write-Host "=================================================="
Write-Host "Code page:     " $Enc.CodePage
Write-Host "Web name:      " $Enc.WebName
Write-Host "Header name:   " $Enc.HeaderName " (destined for e-mail applications)"
Write-Host "Body name:     " $Enc.BodyName " (destined for e-mail applications)"
Write-Host

Batch equivalent to: $(dirname ${0})/$(basename ${0} .<old_suffix>)<new_suffix>

Actually it is not PowerShell but useful in bat scripts starting PowerShell scripts.
%~dp0%~n0.ps1
If you want to use it in the previous post, you cannot put it in a variable first if the result contains space characters. For some obscure reason. Not connected with this fomula.