private/steps/9-postaction/step-postaction-removeosdcloudtemp.ps1
|
function step-postaction-removeosdcloudtemp { [CmdletBinding()] param () #================================================= Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Start" #================================================= $Step = $global:OSDCloudCurrentStep $Path = 'C:\Windows\Temp\osdcloud' Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Temp path: $Path" if (Test-Path $Path) { Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Removing OSDCloud temp path: $Path" Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue } else { Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Temp path was not found. Nothing to remove." } #================================================= Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] End" #================================================= } |