Giter VIP home page Giter VIP logo

powerbginfo's Introduction

PowerBGInfo is a PowerShell module that is used to generate background information for Windows machines. It's a replacement for BGInfo that doesn't require installation and is much more flexible.

You can read about this project on this blog post that tells a little backstory and shows few things.

Installation

Install from PowerShell Gallery is as easy as:

Install-Module PowerBGInfo -Force -Verbose

When there's an update you can update it using same command which will install new module version.

Known Issues

This module will work fine for PowerShell 5.1 and PowerShell 7+. Currently the module has a problem when running in VSCode PowerShell extension when on PowerShell 5.1 (other versions work fine!) It works fine when running in PowerShell 5.1 console, or ISE (shrug!).

Usage

Here's a small taste of the code:

New-BGInfo -MonitorIndex 0 {
    # Lets add computer name, but lets use builtin values for that
    New-BGInfoValue -BuiltinValue HostName -Color Red -FontSize 20 -FontFamilyName 'Calibri'
    # Lets add user name, but lets use builtin values for that
    New-BGInfoValue -BuiltinValue FullUserName -Name "FullUserName" -Color White
    New-BGInfoValue -BuiltinValue CpuName
    New-BGInfoValue -BuiltinValue CpuLogicalCores
    New-BGInfoValue -BuiltinValue RAMSize
    New-BGInfoValue -BuiltinValue RAMSpeed

    # Lets add Label, but without any values, kind of like section starting
    New-BGInfoLabel -Name "Drives" -Color LemonChiffon -FontSize 16 -FontFamilyName 'Calibri'

    # Lets get all drives and their labels
    foreach ($Disk in (Get-Disk)) {
        $Volumes = $Disk | Get-Partition | Get-Volume
        foreach ($V in $Volumes) {
            New-BGInfoValue -Name "Drive $($V.DriveLetter)" -Value $V.SizeRemaining
        }
    }
} -FilePath $PSScriptRoot\Samples\PrzemyslawKlysAndKulkozaurr.jpg -ConfigurationDirectory $PSScriptRoot\Output -PositionX 100 -PositionY 100 -WallpaperFit Center

Here's how the wallpaper will look like:

PowerBGInfo

You can also use only builtin values

New-BGInfo -MonitorIndex 0 {
    # Lets add computer name, but lets use builtin values for that
    New-BGInfoValue -BuiltinValue HostName -Color Red -FontSize 20 -FontFamilyName 'Calibri'
    New-BGInfoValue -BuiltinValue FullUserName -Color White
    New-BGInfoValue -BuiltinValue CpuName -Color White
    New-BGInfoValue -BuiltinValue CpuLogicalCores -Color White -ValueColor Red
    New-BGInfoValue -BuiltinValue RAMSize -Color White
    New-BGInfoValue -BuiltinValue RAMSpeed -Color White -ValueColor ([SixLabors.ImageSharp.Color]::Aquamarine)
    New-BGInfoValue -BuiltinValue RAMPartNumber -Color White
    New-BGInfoValue -BuiltinValue BiosVersion -Color White
    New-BGInfoValue -BuiltinValue BiosManufacturer -Color White
    New-BGInfoValue -BuiltinValue BiosReleaseDate -Color White
    New-BGInfoValue -BuiltinValue OSName -Color White -Name "Operating System"
    New-BGInfoValue -BuiltinValue OSVersion -Color White
    New-BGInfoValue -BuiltinValue OSArchitecture -Color White
    New-BGInfoValue -BuiltinValue OSBuild -Color White
    New-BGInfoValue -BuiltinValue OSInstallDate -Color White
    New-BGInfoValue -BuiltinValue OSLastBootUpTime -Color White

} -FilePath "C:\Support\GitHub\PowerBGInfo\Examples\Samples\TapN-Evotec-1600x900.jpg" -ConfigurationDirectory $PSScriptRoot\Output -PositionX 75 -PositionY 75 -WallpaperFit Fit

Here's the output from command above

PowerBGInfo

powerbginfo's People

Contributors

przemyslawklys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerbginfo's Issues

Method Invocation Method: Addtext

Getting this error when I run the script..any ideas?

Exception calling "AddText" with "6" argument(s): "Method not found: 'Void SixLabors.Fonts.TextOptions.set_Origin(System.Numerics.Vector2)'."
At C:\Program Files\WindowsPowerShell\Modules\PowerBGInfo\0.0.3\PowerBGInfo.psm1:717 char:13

  •         $Image.AddText($PositionX + $HighestWidth + $SpaceBetween ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : MissingMethodException

Display Active IP Adresses

So I have yet to try out PowerBGInfo, but was curious to know if Displaying Active IP Addresses is already part of/or going to be part of PowerBGInfo.

Tried quickly looking through your documentation but could not find anything on it (May have missed it so I apologise if this is a waste of your time)

If not already implemented would it be possible to implement something like the below code?

Get-WmiObject -Query "SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'" | Select-Object -ExpandProperty IPAddress | Where-Object {$_ -like '*.*.*.*'}

This is something we heavily used in BGInfo as End Users struggle to use CMD to provide IP Addresses to their IT Support. Only needed when users are remote workers using VPN and the DNS Server hasn't updated their records.

Total Physical Memory

Hello.
I just found it, I like it, but it shows different memory size on my computer. PowerBGInfo shows 8GB, systeminfo shows 16GB and it should really be 16GB in the laptop. Am I doing something wrong?

Best regards

Honza

SetWallpaper Error

I've managed to get to grips with your script since we last spoke and I've customised it to how we need it, except for an error that keeps appearing which I'm not entirely sure what's causing it

Exception calling "SetWallpaper" with "2" argument(s): "Value does not fall within the expected range."...

This error points to the DesktopManager Module and it directs me to line 29 character 52.

I imagine it's not anything to do with this but rather than the calling script of which I've created.

I've used your example as the base script and not changed anything to do with the functions parameters other than the image it uses and the positions of where the text gets placed.

Would you be able to help me find out the solution to this problem I'm having?

Thanks :)

Suggested execution methods

I'm running my PowerBGInfo script using a scheduled task that runs hourly. The task runs without an error, but the wallpaper doesn't update. When I run it manually with the 5.1 ISE it works as expected. I'm specifying the 5.1 version of PoSh within the task. What scheduled execution methods have you tested and verified? Thanks!

Am I doing something wrong?

C:\ServerWallpaper\SystemBoot.ps1
Import-Module : The term 'Import-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\ServerWallpaper\SystemBoot.ps1:1 char:1

  • Import-Module .\PowerBGInfo.psd1 -Force
  •   + CategoryInfo          : ObjectNotFound: (Import-Module:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

cmdlet New-BGInfo at command pipeline position 1
Supply values for the following parameters:
ConfigurationDirectory:

I downloaded the script from GitHub and have had no luck running on my local pc

Display Active IP Addresses

So I have yet to try out PowerBGInfo, but was curious to know if Displaying Active IP Addresses is already part of/or going to be part of PowerBGInfo.

Tried quickly looking through your documentation but could not find anything on it (May have missed it so I apologise if this is a waste of your time)

If not already implemented would it be possible to implement something like the below code?

Get-WmiObject -Query "SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'" | Select-Object -ExpandProperty IPAddress | Where-Object {$_ -like '...'}

This is something we heavily used in BGInfo as End Users struggle to use CMD to provide IP Addresses to their IT Support. Only needed when users are remote workers using VPN and the DNS Server hasn't updated their records.

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.