added a few Write-Host calls to dev.ps1
This commit is contained in:
parent
88c5e6fd10
commit
c06fc176b3
1 changed files with 8 additions and 2 deletions
|
@ -1,26 +1,31 @@
|
|||
# Function to install packwiz and add it to the system path
|
||||
function Install-Packwiz {
|
||||
# Download packwiz executable
|
||||
#Invoke-WebRequest -Uri "https://seafsh.cc/u/d4R3lH.exe" -OutFile "packwiz.exe"
|
||||
Invoke-WebRequest -Uri "https://seafsh.cc/u/d4R3lH.exe" -OutFile "packwiz.exe"
|
||||
Write-Host "packwiz downloaded successfully!"
|
||||
|
||||
# Create packwiz directory if it doesn't exist
|
||||
$packwizDir = "${env:ProgramFiles}\packwiz"
|
||||
if (-not (Test-Path $packwizDir)) {
|
||||
New-Item -ItemType Directory -Path $packwizDir
|
||||
Write-Host "packwiz directory created successfully!"
|
||||
}
|
||||
|
||||
# Move packwiz executable to the packwiz directory
|
||||
#Move-Item -Path ".\packwiz.exe" -Destination "$packwizDir\packwiz.exe" -Force
|
||||
Move-Item -Path ".\packwiz.exe" -Destination "$packwizDir\packwiz.exe" -Force
|
||||
Write-Host "packwiz moved successfully!"
|
||||
|
||||
# Add packwiz directory to the system path
|
||||
$path = [Environment]::GetEnvironmentVariable("Path", "Machine")
|
||||
if ($path -notlike "*$packwizDir*") {
|
||||
[Environment]::SetEnvironmentVariable("Path", "$path;$packwizDir", "Machine")
|
||||
Write-Host "packwiz added to the system path successfully!"
|
||||
}
|
||||
|
||||
# Generate completion script for powershell
|
||||
$packwizCompletion = packwiz completion powershell
|
||||
$packwizCompletion | Out-String | Out-File -FilePath "$packwizDir\packwiz.ps1" -Encoding utf8
|
||||
Write-Host "packwiz completion script generated successfully!"
|
||||
|
||||
# Define the path to the system PowerShell profile script
|
||||
$systemProfilePath = "${env:SystemRoot}\System32\WindowsPowerShell\v1.0\profile.ps1"
|
||||
|
@ -30,6 +35,7 @@ function Install-Packwiz {
|
|||
New-Item -Path $systemProfilePath -ItemType File | Out-Null
|
||||
}
|
||||
Add-Content -Path $systemProfilePath -Value ". `"$packwizDir\packwiz.ps1`""
|
||||
Write-Host "packwiz completion script added to the system profile script successfully!"
|
||||
}
|
||||
|
||||
# Function to create symlink for pre-commit hook
|
||||
|
|
Reference in a new issue