Hi all
Perhaps it’s a stupid question but I don’t know how to use Test-Battery and Test-NetworkConnection.
I just want to display a popup if the computer is not have a Network connection and if running on battery.
Example :
If (Test-Battery)
{
Show-InstallationPrompt -Message 'bla bla bla' -ButtonMiddleText "Ok"
Exit-Script 0
}
If (Test-NetworkConnection)
{
Show-InstallationPrompt -Message 'bla bla bla' -ButtonMiddleText "Ok"
Exit-Script 0
}
But it’s not working