Merge pull request #435 from Romanitho/log-cleaning

minor changes
pull/436/head
Romain 2023-10-19 15:31:08 +02:00 committed by GitHub
commit 2478d3c11b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -304,6 +304,13 @@ if (Test-Network) {
#Check if user context is activated during system run #Check if user context is activated during system run
if ($IsSystem) { if ($IsSystem) {
#Adds SymLink if Intune managed
$IntuneLogPath = "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs"
if ((Test-Path "$IntuneLogPath") -and !(Test-Path "$IntuneLogPath\WAU-updates.log")) {
Write-ToLog "Creating SymLink for log file (WAU-updates) in Intune Management Extension log folder" "Yellow"
New-Item -Path "$IntuneLogPath\WAU-updates.log" -ItemType SymbolicLink -Value $LogFile -Force -ErrorAction SilentlyContinue | Out-Null
}
#Run WAU in user context if feature is activated #Run WAU in user context if feature is activated
if ($WAUConfig.WAU_UserContext -eq 1) { if ($WAUConfig.WAU_UserContext -eq 1) {
@ -348,13 +355,6 @@ if (Test-Network) {
} }
} }
#Adds SymLink if Intune managed
$IntuneLogPath = "${env:ProgramData}\Microsoft\IntuneManagementExtension\Logs"
if ((Test-Path "$IntuneLogPath") -and !(Test-Path "$IntuneLogPath\WAU-updates.log")) {
Write-ToLog " `nCreating SymLink for log file (WAU-updates) in Intune Management Extension log folder" "Yellow"
New-Item -Path "$IntuneLogPath\WAU-updates.log" -ItemType SymbolicLink -Value $LogFile -Force -ErrorAction SilentlyContinue | Out-Null
}
#End #End
Write-ToLog "End of process!" "Cyan" Write-ToLog "End of process!" "Cyan"
Start-Sleep 3 Start-Sleep 3