I am having troubles getting the Windows Update Log on Server 2016. As documented here Server 2016 now logs Windows update logs differently and to view the logs you need to run a Powershell command from the WindowsUpdate module called Get-WindowsUpdateLog.
The script needs to set the Symbol Cache and it does this by running
'Set-Location $SYM_CACHE'. The symbol cache variable is set earlier in the piece by this:
$WORKDIR = "$env:TEMP\WindowsUpdateLog" $SYM_CACHE = "$WORKDIR\SymCache"
The problem I am getting is that my administrative username is 'secur.tima' and the temp variable is set with the 8.3 filename version of this which is 'C:\Users\SECUR~1.TIM\AppData\Local\Temp\4'
When the script tries to set this as the location it fails with this error:
Set-Location : An object at the specified path C:\Users\SECUR~1.TIM does not exist. At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\WindowsUpdate\WindowsUpdateLog.psm1:194 char:5 + Set-Location $SYM_CACHE + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-Location], PSArgumentException + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetLocationCommand
I have found this over at StackOverflow: https://stackoverflow.com/questions/10782739/how-to-change-to-temp-directory-in-powershell
However that shows how to fix the problem by changing the script. Whilst I could change the script provided by Microsoft, I am wondering if there is some way I can make this work from the server side or change the way that PowerShell handles 8.3 filenames?