Hi
I've run out of idea's regarding my little, I believe ease beginners script, which intented use it to uninstall some packages, I extracted from the registry beforehand(variable $MSI).
Idea is to simply run the msiexec statements found in the registry, and add the switches /quiet and /log.
I've tried several ways in the executing part after $MSI | ForEach-Object {(start-process $_ -ArgumentList $Q) }.
I believe it's a beginners error and hope to get some advise .. :-)
Here is the part of the code and it's output
$MSI=$NO_Reboot_Pakete | Where-Object {$_.UninstallString -like '*Msi*.exe*'} |Select-Object -Property Uninstallstring
$Q='/quiet'
$L='/log C:\01_ITK_TOOLS\Uninstall_ITK.log'
$MSI
if ($Deinstall_Flag -match 'J')
{Write-Host DEINSTALLATION START
$MSI | ForEach-Object {(start-process $_ -ArgumentList $Q) }
}
else
{Write-Host DEINSTALLATION WIRD ABGEBROCHEN}
Fortfahren? J/N: j
UninstallString
---------------
MsiExec.exe /X{15730627-A3E2-4EBA-A431-CAD867DADFFD}
MsiExec.exe /X{941C6E5F-363B-4121-A374-3B2E0DEF877C}
MsiExec.exe /X{C2C2DB64-1BCE-4FA7-962D-457795ECCEC0}
MsiExec.exe /X{13F59938-C595-479C-B479-F171AB9AF64F}
MsiExec.exe /X{15B15395-FF53-44E1-ADAD-FCC279E3CA10}
MsiExec.exe /X{25C64847-B900-48AD-A164-1B4F9B774650}
MsiExec.exe /I{597A58EC-42D6-4940-8739-FB94491B013C}
MsiExec.exe /X{90150000-0138-0409-0000-0000000FF1CE}
DEINSTALLATION START
start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden.
In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand start-process : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene Datei nicht finden. In Zeile:11 Zeichen:61 + $MSI | ForEach-Object {(start-process $_ -Ar ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand PS D:\>