Skip to content

grantcarthew/ps-gcpowershell

Repository files navigation

GCPowerShell

This repository contains a collection of PowerShell modules that contain tools to help you work with the Windows platform. The modules have been published to the PowerShell Gallery.

To prevent function name collisions, every function has a prefix of GC being my initials.

Documentation

Installation

All of the PowerShell modules in this repository have been published to the PowerShell Gallery. This makes the installation of the modules extremely easy.

Judging from the PowerShellGet repository you should be able to install these modules as long as you have PowerShell v3.0 or later installed on your Windows platform. To see what version of PowerShell you have running, open PowerShell and issue the command $host taking note of the version value.

If you wish to upgrade PowerShell on your system see the Windows Management Framework page.

Installation Steps

  1. Open PowerShell As Administrator and type the following commands.
  2. Set-ExecutionPolicy -ExecutionPolicy Unrestricted
    • This command changes the PowerShell Execution Policy.
    • This is only needed to be executed once on each system.
  3. Install-PackageProvider -Name NuGet -Force
    • This command installs support for the PowerShell Gallery.
    • This is only needed to be executed once on each system.
  4. Install-Module -Name <GC Module Name> -Force
    • Replace <GC Module Name> with the module you want to install.

That's all it takes. You can now execute any of the functions listed in the installed modules from PowerShell.

To verify the installed modules type the following command into PowerShell:

Get-Module -ListAvailable -Name GC*

Some of the modules have other dependencies so you may see more than one of the GC* modules installed.

Modules

  • GCDialog: User interface components for building scripts.
  • GCHostsFile: Hosts file management tools for local name resolution.
  • GCTest: Basic True/False system tests.
  • GCWindowsUpdate: Control the Windows Update background service.

GCDialog

Install-Module -Name GCDialog -Force

The GCDialog module contains user interface functions to help you build scripts that require user input.

The GCDialog module contains the following functions:

GCHostsFile

Install-Module -Name GCHostsFile -Force

The GCHostsFile module contains a number of functions to help you manage the hosts file on the Windows platform.

The hosts file is the first place Windows checks for name resolution. It is loaded into the DNS cache whenever it gets updated.

Read more about the hosts file on Wikipedia

The GCHostsFile module contains the following functions:

GCTest

Install-Module -Name GCTest -Force

The GCTest module contains Test-GC* functions for simple True/False system tests.

GCWindowsUpdate

Install-Module -Name GCWindowsUpdate -Force

This module contains functions to interact with the Windows Update service.

I have lost data from open applications because Windows Update decided to reboot on me without retaining current state. After this happened a few times I decided to disable the Windows Update service. This worked well letting me update the platform when I wanted to update. After manually enabling and disabling the Windows Update service I wrote these functions.

Warning: Calling Stop-GCWindowsUpdate will disable the Windows Update background service. This will prevent your system from installing updates until you start the service or run Start-GCWindowsUpdate.

About

An assortment of PowerShell modules

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published