Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Battery Charge Status

Posted on November 9, 2015 By David Kittell
Add-Type -AssemblyName System.Windows.Forms
[Windows.Forms.PowerStatus].GetConstructor(
  [Reflection.BindingFlags]36, $null, [Type[]]@(), $null
).Invoke($null)

Reference: http://poshcode.org/5687

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

PowerShell – Create Zip File

Posted on January 12, 2017

Scenario, you’re on a Windows Server and don’t want to or can’t install a zip program. This script will help you create a zip file without any special program. Caveat: Currently this does not give you any kind of status so it could seem to be doing nothing for a…

Read More

PowerShell – Reset Colors

Posted on October 20, 2017

If you have ever played with the colors of your PowerShell window this will help you reset the colors to default > $psISE.Options SelectedScriptPaneState : Top ShowDefaultSnippets : True ShowToolBar : True ShowOutlining : True ShowLineNumbers : True TokenColors : {[Attribute, #FF00BFFF], [Command, #FF0000FF], [CommandArgument, #FF8A2BE2], [CommandParameter, #FF000080]…} ConsoleTokenColors :…

Read More

WordPress – List All Plugins

Posted on September 22, 2015September 23, 2015

Place the following code on a file ex. ListAllPlugins.php and then navigate to http://yourdomain.com/ListAllPlugins.php <?PHP require($_SERVER[’DOCUMENT_ROOT’] . "/wp-load.php"); require($_SERVER[’DOCUMENT_ROOT’] . "/wp-admin/includes/plugin.php"); function PrintPluginList($option) { $all_plugins = get_plugins(); if ($option == 1) { print_r(array_values($all_plugins)); } else { echo json_encode($all_plugins); } } PrintPluginList($_GET[’op’]); ?> This is a PowerShell script to automate some…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes