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)
1
Install-Module OSD -Force
2
Import-Module OSD -Force
Copied!
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
1
PowerShell
2
Set-ExecutionPolicy RemoteSigned -Force
3
Install-Module OSD -Force
4
Import-Module OSD -Force
Copied!

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
1
OSDHelp
2
Get-OSDHelp
Copied!
These commands are equivalent to the following OSDPad command line. In a nutshell, OSDHelp is really just a shortcut for OSDPad
1
OSDPad -RepoOwner OSDeploy -RepoName OSDHelp
Copied!
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
1
OSDHelp Autopilot
Copied!

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
1
#Requires -RunAsAdministrator
2
#================================================
3
# Install Script
4
#================================================
5
if (!(Get-Command Get-WindowsAutoPilotInfo -ErrorAction Ignore)) {
6
Install-Script Get-WindowsAutoPilotInfo -Force -Verbose
7
}
8
#================================================
9
# Parameters
10
# [[-Name] <String[]>]
11
# [-OutputFile <String>]
12
# [-GroupTag <String>]
13
# [-AssignedUser <String>]
14
# [-Append]
15
# [-Credential <PSCredential>]
16
# [-Partner]
17
# [-Force]
18
# -Online
19
# [-TenantId <String>]
20
# [-AppId <String>]
21
# [-AppSecret <String>]
22
# [-AddToGroup <String>]
23
# [-AssignedComputerName <String>]
24
# [-Assign]
25
# [-Reboot]
26
#================================================
27
& "$env:ProgramFiles\WindowsPowerShell\Scripts\Get-WindowsAutoPilotInfo.ps1"
Copied!

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
1
#Requires -RunAsAdministrator
2
#================================================
3
# Initialize
4
#================================================
5
$Title = 'EventMonitor_Autopilot'
6
$host.ui.RawUI.WindowTitle = $Title
7
$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.size(2000,2000)
8
#================================================
9
# Temp
10
#================================================
11
if (!(Test-Path "$env:SystemDrive\Temp")) {
12
New-Item -Path "$env:SystemDrive\Temp" -ItemType Directory -Force
13
}
14
#================================================
15
# Transcript
16
#================================================
17
$Transcript = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-$Title.log"
18
Start-Transcript -Path (Join-Path "$env:SystemDrive\Temp" $Transcript) -ErrorAction Ignore
19
#================================================
Copied!

GitHub Reposository

If you're insterested, here is the OSDHelp Script Repository on GitHub
GitHub - OSDeploy/OSDHelp: PowerShell Scripts for OSDPad
GitHub

Sponsor

Home
Recast Software
OSDeploy is sponsored by Recast Software
Last modified 3mo ago