diff --git a/cleanW10.ps1 b/cleanW10.ps1 index f56fd21..39b74a5 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -589,20 +589,20 @@ function ExecCommand { ) $path = $params.path.Replace("##mod_path##", $script:current_module_path) $args = $params.arguments.Replace("##mod_path##", $script:current_module_path) - Write-Host -NoNewline "`tExecute : $path : " + Write-Host "`n`tExecute $path : " $path = Invoke-Expression """$($path)""" if ( -not ((Test-Path $path) -or $path -eq "powershell") ) { - Write-Host -ForegroundColor Yellow "File not found" + Write-Host -ForegroundColor Yellow "`t`tFile not found" return } try { - Start-Process -NoNewWindow -wait -filepath $path -ArgumentList $args + Start-Process -NoNewWindow -wait -filepath $path -ArgumentList $args -ErrorAction Stop + Write-Host -ForegroundColor Green "`t`tExecution done" } catch { - Write-Host -NoNewLine -ForegroundColor Red "Error`n`t" + Write-Host -NoNewLine -ForegroundColor Red "`tError`n`t`t" Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message } - Write-Host "`n" } function ProcessModuleFile { @@ -626,7 +626,7 @@ function ProcessModuleFile { $mod.actions | Foreach { $action_file = "" - $current_action = @{} + $current_action = @{} $script:current_module_path = $(Get-ChildItem $path).DirectoryName + "\" + $(Get-ChildItem $path).BaseName + '\' foreach( $p in $_.psobject.properties.name ){ $current_action[$p] = $_.$p