update M365 deployment script to try not to depend on previous deployments
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#Requires -Version 5.1
|
||||
# EmberkomOfficeUserCleanup-v4
|
||||
# Run only as the affected user, at limited privilege; staged by the Office installer.
|
||||
# EmberkomOfficeUserCleanup-v5
|
||||
# Run only as the affected user, at limited privilege; fetched live by its logon task.
|
||||
param([Parameter(Mandatory = $true)][ValidatePattern('^[a-f0-9]{32}$')][string]$DeploymentId)
|
||||
|
||||
function Get-OfficeUserCleanupDefinitions {
|
||||
@@ -184,7 +184,9 @@ $null = Start-Transcript -Path (Join-Path $logFolder "$DeploymentId.log") -Appen
|
||||
try {
|
||||
$null = New-Item -Path $marker -Force
|
||||
Set-ItemProperty -LiteralPath $marker -Name Status -Value 'Running'
|
||||
Invoke-OfficeUserCleanup -Workspace $PSScriptRoot
|
||||
# The scheduled action fetches this helper live into memory. Only protected
|
||||
# synchronization state persists on disk; PSScriptRoot is empty in this mode.
|
||||
Invoke-OfficeUserCleanup -Workspace (Join-Path $env:ProgramData "EmberkomOfficeDeployment\$DeploymentId")
|
||||
Set-ItemProperty -LiteralPath $marker -Name Status -Value 'Complete'
|
||||
} catch {
|
||||
Set-ItemProperty -LiteralPath $marker -Name Status -Value 'Failed'
|
||||
|
||||
Reference in New Issue
Block a user