cloudscript/tasksequences/light.ps1
<#PSScriptInfo
.VERSION 22.5.1.1 .GUID b9c79000-c271-464e-839a-605b3b384c4e .AUTHOR David Segura @SeguraOSD .COMPANYNAME osdcloud.com .COPYRIGHT (c) 2022 David Segura osdcloud.com. All rights reserved. .TAGS OSDeploy OSDCloud WinPE OOBE Windows AutoPilot .LICENSEURI .PROJECTURI https://github.com/OSDeploy/OSD .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES Script should be executed in a Command Prompt using the following command powershell Invoke-Expression -Command (Invoke-RestMethod -Uri raw.osdcloud.com/tasksequences/light.ps1) This is abbreviated as powershell iex (irm raw.osdcloud.com/tasksequences/light.ps1) #> <# .SYNOPSIS PSCloudScript at raw.osdcloud.com/tasksequences/light.ps1 .DESCRIPTION PSCloudScript at raw.osdcloud.com/tasksequences/light.ps1 .NOTES Version 22.5.1.1 .LINK https://raw.githubusercontent.com/OSDeploy/OSD/master/cloudscript/tasksequences/light.ps1 .EXAMPLE powershell iex (irm raw.osdcloud.com/tasksequences/light.ps1) #> [CmdletBinding()] param() #================================================= #Script Information $ScriptName = 'raw.osdcloud.com/tasksequences/light.ps1' $ScriptVersion = '22.5.1.1' #================================================= #region Initialize #Start the Transcript $Transcript = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-OSDCloud.log" $null = Start-Transcript -Path (Join-Path "$env:SystemRoot\Temp" $Transcript) -ErrorAction Ignore #Determine the proper Windows environment if ($env:SystemDrive -eq 'X:') {$WindowsPhase = 'WinPE'} else { $ImageState = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State' -ErrorAction Ignore).ImageState if ($env:UserName -eq 'defaultuser0') {$WindowsPhase = 'OOBE'} elseif ($ImageState -eq 'IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE') {$WindowsPhase = 'Specialize'} elseif ($ImageState -eq 'IMAGE_STATE_SPECIALIZE_RESEAL_TO_AUDIT') {$WindowsPhase = 'AuditMode'} else {$WindowsPhase = 'Windows'} } #Finish initialization Write-Host -ForegroundColor DarkGray "$ScriptName $ScriptVersion $WindowsPhase" #Load OSDCloud Functions Invoke-Expression -Command (Invoke-RestMethod -Uri functions.osdcloud.com) #endregion #================================================= #region WinPE if ($WindowsPhase -eq 'WinPE') { osdcloud-StartWinPE osdcloud-InstallCurl $null = Stop-Transcript -ErrorAction Ignore } #endregion #================================================= #region Specialize if ($WindowsPhase -eq 'Specialize') { $null = Stop-Transcript -ErrorAction Ignore } #endregion #================================================= #region AuditMode if ($WindowsPhase -eq 'AuditMode') { $null = Stop-Transcript -ErrorAction Ignore } #endregion #================================================= #region OOBE if ($WindowsPhase -eq 'OOBE') { osdcloud-StartOOBE $null = Stop-Transcript -ErrorAction Ignore } #endregion #================================================= #region Windows if ($WindowsPhase -eq 'Windows') { $null = Stop-Transcript -ErrorAction Ignore } #endregion #================================================= |