Power Help Files

This blog holds my PowerShell help files for those who have attended my classes. As I add new PowerShell help files into my classes, the online help will be located here.

If you like what you see, contact me and I'll let you know where I am instructing my next class.

Tuesday, September 11, 2012

Create-20410DataDrive

Last Update: September 11, 2012
PowerShell Version: 3.0

Libraries:
  • PSv3.psm1
  • 40210.psm1

.Synopsis
Creates the data drive for MOC 40210.
.DESCRIPTION
Creates a the data drive for MOC 40210.

.PARAMETER Path
The folder location of the VHD files.
.EXAMPLE
Create-40210DataDrive -Path s:\VM\40210A
Creates the data drive for MOC 40210A in the specifid path.

.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentials.
Last updated: September 211, 2012
.COMPONENT
Hyper-V



Install-20410VHDs

Last Update: September 11, 2012

PowerShell Version: 3.0

 

Libraries:

  • PSv3.psm1
  • 40210.psm1
 

.Synopsis
Adds the VHD files from the SSI adapters on VMs
for MOC course 20410A.

.DESCRIPTION
Adds all the VHD files from the VMs used in MOC
20410A: Upgrading your Skills to MCSA Windows 2012.  This
allows for the consistent resetting of all the VMs used in
this course.
 
.PARAMETER Path
The folder location of the VHD files.

.EXAMPLE
Install-20410VHDs

Adds all the VHD files from the SCSI adapters on VMs
for MOC 20410A.

.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentials.

Last updated: September 2, 2012

.COMPONENT
Hyper-V

Friday, September 7, 2012

Write-Quantification

Last Update: September 7, 2012

PowerShell Version: 3.0

Class Library
Instructor Use PSv3.psm1
20417:

Upgrading Your Skills to MCSA Windows Server 2012

20417.psm1

 

.SYNOPSIS
Used to quantify script usage.

.DESCRIPTION
===============================================================================
                        Automation Quantification Function
                            Author: Jason A. Yoder
                                    Version 1.0
-------------------------------------------------------------------------------
This code is designed to be added to existing scripts so they can send
usage information to a central usage file. This will help in quantifying
your automation efforts to management.
Requirements:
- Network location where the file can be stored and accessed for
  write operation.
- Data file location must be online.
- The calling statement needs to be modified to reflect your
  scripts information.
===============================================================================

.PARAMETER ScriptName
The name of the script/cmdlet/function that is being run.

.PARAMETER TimeSaved_Min
Estimated number of minutes of manual labor this script
has saved the user.

.PARAMETER Server
The name of the server where the log file is stored.

.PARAMETER Automatic
To help distinguish from manually ran scripts and those that are
performed via a scheduled task or other automated launch
method.  Set to $True if automatic of $False if
manually initiated.

.PARAMETER Path
The full path to the logfile. 
ex: \\indy-SVR1\ScriptData

.PARAMETER LogFile
The name of the file to record the data.

.EXAMPLE
Write-Quantification "TestScript1.PS1" 10 $env:COMPUTERNAME $True "\\Indy-SVR1\PSData\" "2012Data.csv"

Write to the logfile 2012Data.csv on the server (Extracting the servers name for you)
in the share PSData. The name of the script entered in the log is
"TestScript1.PS1".  It is recording 10 minuets of saved time.

Sunday, September 2, 2012

Uninstall-20417VHDs

Last Update: September 2, 2012

PowerShell Version: 3.0

Class Library
Instructor Use PSv3.psm1
20417:

Upgrading Your Skills to MCSA Windows Server 2012

20417.psm1

 

.Synopsis
Removes the VHD files from the SSI adapters on VMs
for MOC course 20417A.

.DESCRIPTION
Removes all the VHD files from the VMs used in MOC
20417A: Upgrading your Skills to MCSA Windows 2012.  This
allows for the consistent resetting of all the VMs used in
this course.
 

.EXAMPLE
Uninstall-20417VHDs

Removes all the VHD files from the SCSI adapters on VMs
for MOC 20417A.

.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentials.

Last updated: September 2, 2012

.COMPONENT
Hyper-V

Install-20417VHDs

Last Update: September 2, 2012

PowerShell Version: 3.0

Class Library
Instructor Use PSv3.psm1
20417:

Upgrading Your Skills to MCSA Windows Server 2012

20417.psm1

 

.Synopsis
Adds the VHD files from the SSI adapters on VMs
for MOC course 20417A.

.DESCRIPTION
Adds all the VHD files from the VMs used in MOC
20417A: Upgrading your Skills to MCSA Windows 2012.  This
allows for the consistent resetting of all the VMs used in
this course.
 
.PARAMETER Path
The folder location of the VHD files.

.EXAMPLE
Install-20417VHDs

Adds all the VHD files from the SCSI adapters on VMs
for MOC 20417A.

.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentials.

Last updated: September 2, 2012

.COMPONENT
Hyper-V

Restore-ClassVM

Last Update: September 2, 2012

PowerShell Version: 3.0

Class Library
Instructor Use PSv3.psm1

 

.SYNOPSIS
Reverts VMs based in a name pattern and state.

.DESCRIPTION
Selectively reverts virtual machines whose names match a pattern
and operational state.  By default, all VHD files attached to the
VMS will be detached prior to reverting to help preserve
data.

.PARAMETER VMName
The pattern to search for in the VM name. This is a wildcard search.

.PARAMETER SnapShot
The name of the snapshot to revert to.  The default is "StartingImage".

.PARAMETER RunningVMs
Reverts running VMS that match the name pattern.

.PARAMETER StoppedVMs
Reverts stopped VMS that match the name pattern.

.PARAMETER AllVMs
Reverts all VMS that match the name pattern.

.PARAMETER RemoveSCSIDrives
Removes the attached VHD files on the SCSI controllers
prior to reverting the VM.  This helps to protect data
on those VHDs.  The default setting is True.

.EXAMPLE
Restore-ClassVM -VMNanme "20417" -RunningVMs

Reverts all virtual machines whose name contains "20417" and
is in a "Running" state.


.EXAMPLE
Restore-ClassVM -VMNanme "20417" -StoppedVMs -RemoveSCSIDrives $false

Reverts all virtual machines whose name contains "20417" and
is in a "Stopped" state.  This cmdlet will also not remove the VHD files
on the SCSI controllers resulting in possible loss of data on those drives.

.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentails.

.COMPONENT
Hyper-V