OSDHelp

In a nutshell, OSDHelp is a PowerShell function (Get-OSDHelp) that opens a GitHub Repository in OSDPad. My goal is to populate this with PowerShell Scripts that can help you perform tasks, or learn a little PowerShell. Any script in OSDHelp can be edited and customized before you run it

Install

To install and use OSDHelp, you need to first install the OSD PowerShell Module. Use the following commands in PowerShell (as Admin)

Install-Module OSD -Force
Import-Module OSD -Force

If you are in OOBE, you can do this from the Command Prompt using these commands. You will need to press Shift + F10 to open a Command Prompt first

PowerShell
Set-ExecutionPolicy RemoteSigned -Force
Install-Module OSD -Force
Import-Module OSD -Force

Usage

OSDHelp can be run using either of the following commands. It is strongly recommended that you always run OSDHelp in an Elevated PowerShell session as many of the scripts require Admin Rights

OSDHelp
Get-OSDHelp

These commands are equivalent to the following OSDPad command line. In a nutshell, OSDHelp is really just a shortcut for OSDPad

OSDPad -RepoOwner OSDeploy -RepoName OSDHelp

Content in OSDHelp changes frequently to add or update scripts

RepoFolder

OSDHelp scripts are organized in directories in the GitHub Repository. These directories are also known as a RepoFolder. If you run OSDHelp without specifying a RepoFolder, you are simply presented with a Readme.md which serves as an Index so you know what RepoFolders are available

You can also look in the minimized PowerShell Console and see the GitHub Directories (RepoFolder)

Now that you know what RepoFolder you can use, simply close OSDHelp (OSDPad) and go back to PowerShell and give it a try

OSDHelp Autopilot

Script Dependencies

Scripts may require a Script or a Module install before executing. You can see how this is done in the following OSDHelp Script

#Requires -RunAsAdministrator
#================================================
#   Install Script
#================================================
if (!(Get-Command Get-WindowsAutoPilotInfo -ErrorAction Ignore)) {
    Install-Script Get-WindowsAutoPilotInfo -Force -Verbose
}
#================================================
#   Parameters
#   [[-Name] <String[]>]
#   [-OutputFile <String>]
#   [-GroupTag <String>]
#   [-AssignedUser <String>] 
#   [-Append]
#   [-Credential <PSCredential>]
#   [-Partner]
#   [-Force]
#   -Online
#   [-TenantId <String>]
#   [-AppId <String>]
#   [-AppSecret <String>]
#   [-AddToGroup <String>] 
#   [-AssignedComputerName <String>]
#   [-Assign]
#   [-Reboot]
#================================================
& "$env:ProgramFiles\WindowsPowerShell\Scripts\Get-WindowsAutoPilotInfo.ps1"

Script Transcript Logging

Many of the scripts will save a Transcript. In most cases, these are saved in Windows Temp or User Temp. In the following script in particular, this is saved in C:\Temp so the Transcript can be retreived by a Standard User. This is by design

#Requires -RunAsAdministrator
#================================================
#   Initialize
#================================================
$Title = 'EventMonitor_Autopilot'
$host.ui.RawUI.WindowTitle = $Title
$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.size(2000,2000)
#================================================
#   Temp
#================================================
if (!(Test-Path "$env:SystemDrive\Temp")) {
    New-Item -Path "$env:SystemDrive\Temp" -ItemType Directory -Force
}
#================================================
#   Transcript
#================================================
$Transcript = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-$Title.log"
Start-Transcript -Path (Join-Path "$env:SystemDrive\Temp" $Transcript) -ErrorAction Ignore
#================================================

GitHub Reposository

If you're insterested, here is the OSDHelp Script Repository on GitHub

Last updated