From 098c590084267115ccca055dbac4efac9b554dfc Mon Sep 17 00:00:00 2001 From: David Yoder Date: Tue, 27 Feb 2024 11:09:13 -0500 Subject: [PATCH] print message if no battery detected --- Create-BatteryReport.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Create-BatteryReport.ps1 b/Create-BatteryReport.ps1 index 7f1a317..98bad2a 100644 --- a/Create-BatteryReport.ps1 +++ b/Create-BatteryReport.ps1 @@ -1,5 +1,5 @@ # Exit this script if the current device doesn't have a built-in battery -If ( $null -eq (Get-CimInstance -ClassName Win32_Battery -ErrorAction SilentlyContinue) ) { Exit } +If ( $null -eq (Get-CimInstance -ClassName Win32_Battery -ErrorAction SilentlyContinue) ) { Microsoft.Powershell.Utility\Write-Output "This endpoint does not have a battery" ; Exit } # Define file paths $Today = Get-LongDate