Files
management-scripts/Fix-AutodeskProductLicensing.ps1
T
dyoder ae42120f1f cleanup after finished (Fix-AutodeskProductLicensing.ps1)
add service installation (Install-Wireguard.ps1)
2020-12-23 08:16:37 -05:00

31 lines
1.3 KiB
PowerShell

. 'C:\Users\dyoder\Emberkom\Data\Projects\development\management-scripts\Tools.ps1'
$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AdskLicensingSupportTool.exe'
$LicensingSupportTool = Download-File -URL $URL
$WorkingDir = Split-Path -Path $LicensingSupportTool -Parent
If ( Test-Path $LicensingSupportTool ) {
LogMsg "Extracting Autodesk Licensing Support Tool to ""${WorkingDir}"""
Try { Start-Process "${LicensingSupportTool}" -ArgumentList "-o""${WorkingDir}"" -y" -WorkingDirectory $WorkingDir -Wait }
Catch { LogErr $_.Exception.Message ; Exit }
}
$ALST = "${WorkingDir}\AdskLicensingSupportTool\AdskLicensingSupportTool.exe"
If ( Test-Path $ALST ) {
LogMsg "Resetting all Autodesk product licenses to named-user licenses"
Try { Start-Process $ALST -ArgumentList '-r ALL:USER' -Wait }
Catch { LogErr $_.Exception.Message }
}
If ( Test-Path $LicensingSupportTool ) {
LogMsg "Deleting ""${LicensingSupportTool}"""
Try { Remove-Item $LicensingSupportTool -Force -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message }
}
If ( Test-Path $WorkingDir ) {
LogMsg "Deleting ""${WorkingDir}"""
Try { Remove-Item $WorkingDir -Recurse -Force -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message }
}