Skip to content

Commit

Permalink
Merge pull request hashicorp#6817 from hashicorp/fix_6761
Browse files Browse the repository at this point in the history
provide useful powershell error
  • Loading branch information
SwampDragons authored Oct 12, 2018
2 parents edea48a + 847a3b0 commit cee0b81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/powershell/powershell.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (ps *PowerShellCmd) Run(fileContents string, params ...string) error {
func (ps *PowerShellCmd) Output(fileContents string, params ...string) (string, error) {
path, err := ps.getPowerShellPath()
if err != nil {
return "", err
return "", fmt.Errorf("Cannot find PowerShell in the path")
}

filename, err := saveScript(fileContents)
Expand Down Expand Up @@ -239,7 +239,7 @@ param([string]$moduleName)

func HasVirtualMachineVirtualizationExtensions() (bool, error) {

var script = `
var script = `
(GET-Command Hyper-V\Set-VMProcessor).parameters.keys -contains "ExposeVirtualizationExtensions"
`

Expand Down Expand Up @@ -344,7 +344,7 @@ param([string]$path,[string]$productKey)
$unattend = [xml](Get-Content -Path $path)
$ns = @{ un = 'urn:schemas-microsoft-com:unattend' }
$setupNode = $unattend |
$setupNode = $unattend |
Select-Xml -XPath '//un:settings[@pass = "specialize"]/un:component[@name = "Microsoft-Windows-Shell-Setup"]' -Namespace $ns |
Select-Object -ExpandProperty Node
Expand Down

0 comments on commit cee0b81

Please sign in to comment.