updated to latest version using source url

This commit is contained in:
2022-09-08 14:42:31 -04:00
parent 16db6cf5bf
commit a887e460aa
+16 -9
View File
@@ -1,18 +1,19 @@
$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AdskLicensingSupportTool.exe' . $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
# https://knowledge.autodesk.com/search-result/caas/downloads/content/licensing-support-tool.html
$URL = 'https://knowledge.autodesk.com/sites/default/files/file_downloads/AdskLicensingSupportTool-2.2.0.502-win.zip'
# Download the zip archive
$LicensingSupportTool = Download-File -URL $URL $LicensingSupportTool = Download-File -URL $URL
$WorkingDir = Split-Path -Path $LicensingSupportTool -Parent
If ( Test-Path $LicensingSupportTool ) { # Extract the downloaded zip file
LogMsg "Extracting Autodesk Licensing Support Tool to ""${WorkingDir}""" Unzip-Object $LicensingSupportTool
Try { Start-Process "${LicensingSupportTool}" -ArgumentList "-o""${WorkingDir}"" -y" -WorkingDirectory $WorkingDir -Wait }
Catch { LogErr $_.Exception.Message ; Exit }
}
$ALST = "${WorkingDir}\AdskLicensingSupportTool\AdskLicensingSupportTool.exe" $WorkingDir = '{0}\{1}' -f (Split-Path -Path $LicensingSupportTool -Parent), "AdskLicensingSupportTool"
$ALST = "${WorkingDir}\AdskLicensingSupportTool.exe"
If ( Test-Path $ALST ) { If ( Test-Path $ALST ) {
LogMsg "Resetting all Autodesk product licenses to named-user licenses" LogMsg "Resetting all Autodesk product licenses to named-user licenses"
Try { Start-Process $ALST -ArgumentList '-r ALL:USER' -Wait } Try { Start-Process $ALST -ArgumentList '-r ALL:User' -Wait }
Catch { LogErr $_.Exception.Message } Catch { LogErr $_.Exception.Message }
} }
@@ -20,4 +21,10 @@ If ( Test-Path $LicensingSupportTool ) {
LogMsg "Deleting ""${LicensingSupportTool}""" LogMsg "Deleting ""${LicensingSupportTool}"""
Try { Remove-Item $LicensingSupportTool -Force -ErrorAction SilentlyContinue } Try { Remove-Item $LicensingSupportTool -Force -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message } Catch { LogErr $_.Exception.Message }
}
If ( Test-Path $WorkingDir ) {
LogMsg "Deleting ""${WorkingDir}"""
Try { Remove-Item $WorkingDir -Force -Recurse -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message }
} }