Skip to content

Commit

Permalink
Added support for installing with a Powershell script
Browse files Browse the repository at this point in the history
  • Loading branch information
1dustindavis committed Aug 13, 2018
1 parent 868477e commit 0733afe
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ func Install(item catalog.Item, cachePath string, verbose bool, repoURL string)
fmt.Println("EXE support not added yet:", fileName)
return
} else if fileExt == ".ps1" {
fmt.Println("Powershell support not added yet:", fileName)
return
fmt.Println("Installing via Powershell:", fileName)
installCmd = filepath.Join(os.Getenv("WINDIR"), "system32/", "WindowsPowershell", "v1.0", "powershell.exe")
installArgs = []string{"-NoProfile", "-NoLogo", "-NonInteractive", "-WindowStyle", "Normal", "-ExecutionPolicy", "Bypass", "-File", absFile}

} else {
fmt.Println("Unable to install", fileName)
fmt.Println("Installer type unsupported:", fileExt)
Expand Down Expand Up @@ -285,12 +287,12 @@ func Upgrade(item catalog.Item, cachePath string, verbose bool, repoURL string)
} else if fileExt == ".ps1" {
fmt.Println("Powershell support not added yet:", fileName)
return
} else {
fmt.Println("Unable to install", fileName)
fmt.Println("Installer type unsupported:", fileExt)
return
}

fmt.Println("Unable to install", fileName)
fmt.Println("Installer type unsupported:", fileExt)
return

runCommand(installCmd, installArgs, verbose)

return
Expand Down

0 comments on commit 0733afe

Please sign in to comment.