From 37bb194595fac1da30ba360a80ebe2c4f926aae6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 11 Apr 2018 22:29:18 +0200 Subject: [PATCH] Path testing was wrong --- cleanW10.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cleanW10.ps1 b/cleanW10.ps1 index b774f9b..3b47be0 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -592,17 +592,18 @@ function ExecCommand { $args = $params.arguments.Replace("##mod_path##", $script:current_module_path) Write-Host -NoNewline "`tExecute : $path : " $path = Invoke-Expression """$($path)""" - if ( -not (Test-Path $path) -and -not $path -eq "powershell" ) { + if ( -not ((Test-Path $path) -or $path -eq "powershell") ) { Write-Host -ForegroundColor Yellow "File not found" - return + return } try { Start-Process -NoNewWindow -wait -filepath $path -ArgumentList $args } catch { Write-Host -NoNewLine -ForegroundColor Red "Error`n`t" - write-Host -ForegroundColor DarkRed $Error[0].Exception.Message + Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message } + Write-Host "`n" } function ProcessModuleFile {