Skip to content

Commit

Permalink
V7.25
Browse files Browse the repository at this point in the history
  • Loading branch information
mniederw committed Jul 31, 2023
1 parent b08eef0 commit da78361
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ScriptGetTopCaller (){ [String] $f = $global:MyInvoca
if( ($f -match "^\'.+\'$") -or ($f -match "^\`".+\`"$") ){ $f = $f.Substring(1,$f.Length-2); }
return [String] $f; } # return empty if called interactive.
function ProcessIsLesserEqualPs5 (){ return [Boolean] ($PSVersionTable.PSVersion.Major -le 5); }
function ProcessPsExecutable (){ return [String] $(switch((ProcessIsLesserEqualPs5)){ $true{"powershell.exe"} default{"pwsh"}}); }
function ProcessPsExecutable (){ return [String] $(switch((ProcessIsLesserEqualPs5)){ $true{"powershell.exe"} default{"pwsh"}}); } # usually in $PSHOME
function ProcessIsRunningInElevatedAdminMode (){ return [Boolean] ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).
IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"); }
function ProcessRestartInElevatedAdminMode (){ if( -not (ProcessIsRunningInElevatedAdminMode) ){
Expand Down
6 changes: 4 additions & 2 deletions MnCommonPsToolLib/MnCommonPsToolLib.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# Version: Own version variable because manifest can not be embedded into the module itself only by a separate file which is a lack.
# Major version changes will reflect breaking changes and minor identifies extensions and third number are for urgent bugfixes.
[String] $global:MnCommonPsToolLibVersion = "7.24"; # more see Releasenotes.txt
[String] $global:MnCommonPsToolLibVersion = "7.25"; # more see Releasenotes.txt

# Prohibits: refs to uninit vars, including uninit vars in strings; refs to non-existent properties of an object; function calls that use the syntax for calling methods; variable without a name (${}).
Set-StrictMode -Version Latest;
Expand Down Expand Up @@ -468,7 +468,7 @@ function OutStartTranscriptInTempDir ( [String] $name = "MnCommonPsTool
[String] $f = "$env:TEMP/tmp/$name/$((DateTimeNowAsStringIso $pattern).Replace(" ","/")).$name.txt"; # works for windows and linux
Start-Transcript -Path $f -Append -IncludeInvocationHeader | Out-Null;
return [String] $f; }
function OutStopTranscript (){ Stop-Transcript; }
function OutStopTranscript (){ Stop-Transcript | Out-Null; } # Writes to output: Transcript stopped, output file is C:\Temp\....txt
function StdInAssertAllowInteractions (){ if( $global:ModeDisallowInteractions ){
throw [Exception] "Cannot read for input because all interactions are disallowed, either caller should make sure variable ModeDisallowInteractions is false or he should not call an input method."; } }
function StdInReadLine ( [String] $line ){ OutStringInColor "Cyan" $line; StdInAssertAllowInteractions; return [String] (Read-Host); }
Expand Down Expand Up @@ -3350,3 +3350,5 @@ Export-ModuleMember -function *; # Export all functions from this script which a
# see https://devblogs.microsoft.com/powershell/introduction-to-cim-cmdlets/
# - Encoding problem on PS5: There is no encoding as UTF8NoBOM, so for UTF8 it generally writes a BOM, alternative code would be:
# [System.IO.File]::WriteAllLines($f,$lines,(New-Object System.Text.UTF8Encoding $false))
# - More on differences of PS5 and PS7 see: https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.3
#
1 change: 1 addition & 0 deletions Releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Major version will reflect breaking changes, minor identifies extensions and thi
Breaking changes are usually removed deprecated functions or changed behaviours.
Current version can be requested by: $MnCommonPsToolLibVersion

2023-07-31 V7.25 Fix OutStopTranscript.
2023-07-11 V7.24 Fix OutStartTranscriptInTempDir, remove gh update notification, improve gh action.
2023-06-09 V7.23 Add RegistryKeyGetOwnerAsString, Improve RegistryKeySetOwner.
2023-05-08 V7.22 Specialize encoding from UTF8 to UTF8BOM for StreamToCsvFile, StreamToXmlFile, StreamToFile, FileWriteFromString, FileWriteFromLines, FileCreateEmpty, FileAppendLine, FileAppendLines, ToolAddLineToConfigFile.
Expand Down

0 comments on commit da78361

Please sign in to comment.