|
@@ -40,7 +40,7 @@ new-module -name netclient-install -scriptblock {
|
|
if (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe") {
|
|
if (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe") {
|
|
$outpath = "C:\ProgramData\Netclient\bin\netclient.exe";
|
|
$outpath = "C:\ProgramData\Netclient\bin\netclient.exe";
|
|
} else {
|
|
} else {
|
|
- $outpath = "$env:userprofile\Downloads\netclient.exe"
|
|
|
|
|
|
+ $outpath = Get-Location
|
|
Write-Host "'netclient.exe' is NOT installed. installing...";
|
|
Write-Host "'netclient.exe' is NOT installed. installing...";
|
|
Write-Host "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe";
|
|
Write-Host "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe";
|
|
$url = "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe"
|
|
$url = "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe"
|
|
@@ -56,7 +56,8 @@ new-module -name netclient-install -scriptblock {
|
|
if ((Get-Command "netclient.exe" -ErrorAction SilentlyContinue) -eq $null) {
|
|
if ((Get-Command "netclient.exe" -ErrorAction SilentlyContinue) -eq $null) {
|
|
if (-not (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe")) {
|
|
if (-not (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe")) {
|
|
New-Item -Path "C:\ProgramData\Netclient" -Name "bin" -ItemType "directory"
|
|
New-Item -Path "C:\ProgramData\Netclient" -Name "bin" -ItemType "directory"
|
|
- Move-Item -Path "$env:userprofile\Downloads\netclient.exe" -Destination "C:\ProgramData\Netclient\bin\netclient.exe"
|
|
|
|
|
|
+ curDir = Get-Location
|
|
|
|
+ Move-Item -Path "$curDur\netclient.exe" -Destination "C:\ProgramData\Netclient\bin\netclient.exe"
|
|
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
|
|
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
|
|
$newpath = "$oldpath;C:\ProgramData\Netclient\bin"
|
|
$newpath = "$oldpath;C:\ProgramData\Netclient\bin"
|
|
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
|
|
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
|