From 3be5dd6e2592912665341415d089e33e5312efd2 Mon Sep 17 00:00:00 2001 From: Marc Niederwieser Date: Mon, 21 Aug 2023 16:48:06 +0200 Subject: [PATCH] V7.26 --- MnCommonPsToolLib/MnCommonPsToolLib_Windows.ps1 | 4 ++-- Releasenotes.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MnCommonPsToolLib/MnCommonPsToolLib_Windows.ps1 b/MnCommonPsToolLib/MnCommonPsToolLib_Windows.ps1 index 83c39f7..dc6728b 100644 --- a/MnCommonPsToolLib/MnCommonPsToolLib_Windows.ps1 +++ b/MnCommonPsToolLib/MnCommonPsToolLib_Windows.ps1 @@ -25,7 +25,7 @@ function JobWaitForEnd ( [Int32] $id ){ JobWaitForNotRunn function OsIsWinVistaOrHigher (){ return [Boolean] ([Environment]::OSVersion.Version -ge (new-object "Version" 6,0)); } function OsIsWin7OrHigher (){ return [Boolean] ([Environment]::OSVersion.Version -ge (new-object "Version" 6,1)); } function OsIs64BitOs (){ return [Boolean] (Get-CimInstance -Class Win32_OperatingSystem -ErrorAction SilentlyContinue).OSArchitecture -eq "64-Bit"; } -function OsIsWinScreenLocked (){ return [Boolean] ((Get-Process | Where-Object{ $_.ProcessName -eq "LogonUI"}).Count -gt 0); } +function OsIsWinScreenLocked (){ return [Boolean] ((@()+(Get-Process | Where-Object{ $_.ProcessName -eq "LogonUI"})).Count -gt 0); } function OsIsHibernateEnabled (){ if( (FileNotExists "$env:SystemDrive/hiberfil.sys") ){ return [Boolean] $false; } if( OsIsWin7OrHigher ){ return [Boolean] (RegistryGetValueAsString "HKLM:\SYSTEM\CurrentControlSet\Control\Power" "HibernateEnabled") -eq "1"; } @@ -828,7 +828,7 @@ function InfoAboutNetConfig (){ ,"NetGetNbtStat:" ,(NetGetNbtStat) , "" ,"NetGetAdapterSpeed:" ,(NetAdapterListAll | StreamToTableString | StreamToStringIndented) ,"" ); } function InfoGetInstalledDotNetVersion ( [Boolean] $alsoOutInstalledClrAndRunningProc = $false ){ - # Requires clrver.exe in path, for example "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.x Tools\x64\clrver.exe" + # Requires clrver.exe in path, for example "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\x64\clrver.exe" if( $alsoOutInstalledClrAndRunningProc ){ [String[]] $a = @(); $a += "List Installed DotNet CLRs (clrver.exe):"; diff --git a/Releasenotes.txt b/Releasenotes.txt index c87ef37..1e4afde 100644 --- a/Releasenotes.txt +++ b/Releasenotes.txt @@ -5,7 +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-08-08 V7.26 Improve GitGetBranch. +2023-08-08 V7.26 Improve GitGetBranch. Fix OsIsWinScreenLocked. 2023-07-07 V7.25 Improve ForEachParallel. Extend Install.ps1 for linux. Improve Import-Module handling. 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.