Giter Site home page Giter Site logo

get-batterylevel's Introduction

Get-BatteryLevel

Get-BatteryLevel displays a graphical representation of the current battery charge level as well as the percentage of charge remaining

Usage

Syntax

Get-BatteryLevel

Example

On Battery

C:\>Get-BatteryLevel
☨▓▓▓▓▓▓▓▓▓▓░ (98%)

On A/C Power

C:\>Get-BatteryLevel
⚡▓▓▓▓▓▓▓▓▓▓░ (98%)

get-batterylevel's People

Watchers

James Cloos avatar  avatar

get-batterylevel's Issues

Cannot dot source Get-BatteryLevel.ps1

When trying to dot source the file to bring the function into PowerShell, it fails with the following errors:

At C:\PowerShellScripts\Get-BatteryLevel\Get-BatteryLevel.ps1:13 char:20
+         write-host "â–‘" -NoNewline
+                       ~~~~~~~~~~~~~
The string is missing the terminator: '.
At C:\PowerShellScripts\Get-BatteryLevel\Get-BatteryLevel.ps1:9 char:35
+         if ($_ -le $BatteryLevel) {
+                                   ~
Missing closing '}' in statement block or type definition.
At C:\PowerShellScripts\Get-BatteryLevel\Get-BatteryLevel.ps1:8 char:28
+     0..10 | ForEach-Object {
+                            ~
Missing closing '}' in statement block or type definition.
At C:\PowerShellScripts\Get-BatteryLevel\Get-BatteryLevel.ps1:1 char:27
+ function Get-BatteryLevel {
+                           ~
Missing closing '}' in statement block or type definition.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

I'm not sure why this happens but it appears to be related to one of the symbols used for the battery life indicator.
If you copy and paste the function into PowerShell, it works fine.
If you include the text of the function in your PowerShell profile then it works fine. See my PowerShell Profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.