File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ # Set proper execution policy
2+ Set-ExecutionPolicy RemoteSigned - Scope CurrentUser
3+
4+ # Define the URL of the file to download
5+ $sourceUrl = " https://github.com/pmaldona/pyRN/raw/main/glpk-4.65.zip"
6+
7+ # Define the temporary location to store the downloaded file and the
8+ extraction folder
9+ $tempLocation = " $env: TEMP \glpk-4.65.zip"
10+ $extractedFolder = " $env: TEMP \glpk-4.65"
11+
12+ # Define the destination system folder
13+ $systemFolder = " ${env: SystemRoot} \System32"
14+
15+ # Download the file
16+ Invoke-WebRequest - Uri $sourceUrl - OutFile $tempLocation
17+
18+ # Extract the contents of the zip file
19+ Expand-Archive - Path $tempLocation - DestinationPath $extractedFolder
20+
21+ # Copy the files from the w64 folder to the system folder
22+ $sourceFiles = Get-ChildItem - Path " $extractedFolder \w64" - Recurse
23+ $sourceFiles | ForEach-Object {
24+ $destinationPath = Join-Path $systemFolder
25+ $_.FullName.Substring ($extractedFolder.Length + 4 )
26+ Write-Output $destinationPath
27+ # Copy-Item -Path $_.FullName -Destination $destinationPath
28+ - Force
29+ Copy-Item - Path $_.FullName - Destination $systemFolder - Force
30+
31+ }
32+
33+ # Clean up - delete the temporary files and folder
34+ Remove-Item $tempLocation - Force
35+ Remove-Item $extractedFolder - Recurse - Force
36+
37+ Write-Host " glpk-4.65 files copied to the system folder."
38+
You can’t perform that action at this time.
0 commit comments