-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest 4.bat
More file actions
19 lines (16 loc) · 1.01 KB
/
Test 4.bat
File metadata and controls
19 lines (16 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@echo off
cd /d "%~dp0"
REM Elevate the script using PowerShell
PowerShell.exe -Command "Start-Process -FilePath '%0' -Verb RunAs -ArgumentList '-elevated'" -NoProfile -ExecutionPolicy Bypass
exit /b
REM Run PowerShell commands with elevated privileges
PowerShell.exe -ExecutionPolicy Bypass -Command "Install-PackageProvider -Name NuGet -Force"
PowerShell.exe -ExecutionPolicy Bypass -Command "Install-Module -Name PowerShellGet -SkipPublisherCheck -Force"
PowerShell.exe -ExecutionPolicy Bypass -Command "Install-Module -Name HPCMSL -AcceptLicense -Force; ^
mkdir C:\SWSetup; ^
cd C:\SWSetup; ^
Install-HPImageAssistant -Extract -DestinationPath 'C:\HPIA'; ^
Start-Process -FilePath 'C:\HPIA\HPImageAssistant.exe' -ArgumentList '/Operation:Analyze /Category:All /Selection:All /Action:Install /SoftpaqDownloadFolder:C:\SWSetup /noninteractive /ReportFolder:C:\Logs -NoNewWindow -Wait; ^
New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce -Value HPIA -Force"
rd /s /q C:\HPIA C:\SWSetup
exit