private/steps/9-postaction/step-postaction-removeosdcloudlogs.ps1
function step-postaction-removeosdcloudlogs { [CmdletBinding()] param () #================================================= # Start the step $Message = "[$(Get-Date -format G)] [$($MyInvocation.MyCommand.Name)] Start" Write-Debug -Message $Message; Write-Verbose -Message $Message # Get the configuration of the step $Step = $global:OSDCloudWorkflowCurrentStep #================================================= # Stop Transcript at this point as this file is locked and will cause issues with cleanup $null = Stop-Transcript -ErrorAction SilentlyContinue $Path = 'C:\Windows\Temp\osdcloud-logs' if (Test-Path $Path) { Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue } #================================================= # End the function $Message = "[$(Get-Date -format G)] [$($MyInvocation.MyCommand.Name)] End" Write-Verbose -Message $Message; Write-Debug -Message $Message #================================================= } |