Hi,
Please help me with this… I got error when I run it.
Start-Process -FilePath “$PSScriptRoot\setup.exe /L -Append E:\Redirected\Tmp\Logs -loglevel:6” -ArgumentList “-s -clean -noreboot -noeula” -Wait
Hi,
Please help me with this… I got error when I run it.
Start-Process -FilePath “$PSScriptRoot\setup.exe /L -Append E:\Redirected\Tmp\Logs -loglevel:6” -ArgumentList “-s -clean -noreboot -noeula” -Wait
The1SubZer0,
Welcome to the forum. ![]()
What error? Errors are an important feature telling you what’s wrong with your code. Please always share the error messages you get completely and formatted as code.
And when you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
How to format code in PowerShell.org <---- Click
![]()
Why did you actually include some command line arguments in the -FilePath parameter and put the rest of them in the -ArgumentList? They belong all to the -Argumentlist actually.
Hi.
Sorry about that
if ((!((get-wmiobject -class win32_computersystem).model -eq ‘Virtual Machine’)) -and (!(Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$.DisplayName -eq “NVIDIA Graphics Driver 471.68” })) -and (!(Get-PnpDevice -Class Display | Where {$.Name -like ‘NVIDIA Geforce*’}))) {
Write-Host “Display adapter is not a NVIDIA Geforce and NVIDIA Graphics Driver v471.68 is not installed! Updating driver…”
Start-Process -FilePath “$PSScriptRoot\setup.exe /L -Append E:\Redirected\Tmp\Logs -loglevel:6” -ArgumentList “-s -clean -noreboot -noeula” -Wait
Start-Process -FilePath “$PSScriptRoot\Setup.exe /L -Append E:\Redirected\Tmp\Logs’ -loglevel:6” -ArgumentList “-s -clean -noreboot -noeula” -Wait
}
Else {
Write-Host “Running in a VM or display adapter is a NVIDIA Geforce or NVIDIA Graphics Driver v471.68 already installed! Exiting.”
}
if ((!((get-wmiobject -class win32_computersystem).model -eq 'Virtual Machine')) -and (!(Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -eq "NVIDIA Graphics Driver 471.68" })) -and (!(Get-PnpDevice -Class Display | Where {$_.Name -like 'NVIDIA Geforce*'}))) {
Write-Host "Display adapter is not a NVIDIA Geforce and NVIDIA Graphics Driver v471.68 is not installed! Updating driver..."
Start-Process -FilePath "$PSScriptRoot\setup.exe /L -Append E:\Redirected\Tmp\Logs -loglevel:6" -ArgumentList "-s -clean -noreboot -noeula" -Wait
Start-Process -FilePath "$PSScriptRoot\Setup.exe /L -Append E:\Redirected\Tmp\Logs' -loglevel:6" -ArgumentList "-s -clean -noreboot -noeula" -Wait
}
Else {
Write-Host "Running in a VM or display adapter is a NVIDIA Geforce or NVIDIA Graphics Driver v471.68 already installed! Exiting."
}
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\SimDRV-nVidia-Drivers-v471.68\Install-Nvidia_471.68.ps1:3 char:5
Start-Process -FilePath "$PSScriptRoot\Quadro\setup.exe /L 'E:\Re ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\SimDRV-nVidia-Drivers-v471.68\Install-Nvidia_471.68.ps1:4 char:5
Start-Process -FilePath "$PSScriptRoot\PhysX\Setup.exe /L 'E:\Red ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Again: Why did you actually include some command line arguments in the -FilePath parameter and put the rest of them in the -ArgumentList ? They belong all to the -Argumentlist actually.
Please provide only the path and name of the executable to the paramter -FilePath. The rest of the needed command line should be provided to the parameter -ArgumentList.
And please fix the formatting of your code. I linked the desciption in my first answer.
Thank you for the quick response.
I fixed the ArgumentList.
if ((!((get-wmiobject -class win32_computersystem).model -eq 'Virtual Machine')) -and (!(Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -eq "NVIDIA Graphics Driver 471.68" })) -and (!(Get-PnpDevice -Class Display | Where {$_.Name -like 'NVIDIA Geforce*'}))) {
Write-Host "Display adapter is not a NVIDIA Geforce and NVIDIA Graphics Driver v471.68 is not installed! Updating driver..."
Start-Process -FilePath $PSScriptRoot\setup.exe -ArgumentList '-s -clean -noreboot -noeula -Append E:\Redirected\Tmp\Logs -Loglevel:6' -Wait
Start-Process -FilePath $PSScriptRoot\Setup.exe -ArgumentList '-s -clean -noreboot -noeula -Append E:\Redirected\Tmp\Logs -Loglevel:6' -Wait
}
Else {
Write-Host "Running in a VM or display adapter is a NVIDIA Geforce or NVIDIA Graphics Driver v471.68 already installed! Exiting."
}
```There is not error code when I ran this PS
Does that mean your issue is fixed?
no, it didn’t install the program
OK - new question: Why do you run the command twice? ![]()
You’re obviously collecting an installation log file. Did you check it for more info?
It was in 2 separate programs in 2 separate folders.
It needs to install by order and log each installation.
if ((!((get-wmiobject -class win32_computersystem).model -eq 'Virtual Machine')) -and (!(Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -eq "NVIDIA Graphics Driver 471.68" })) -and (!(Get-PnpDevice -Class Display | Where {$_.Name -like 'NVIDIA Geforce*'}))) {
Write-Host "Display adapter is not a NVIDIA Geforce and NVIDIA Graphics Driver v471.68 is not installed! Updating driver..."
Start-Process -FilePath $PSScriptRoot\1\setup.exe -ArgumentList '-s -clean -noreboot -noeula -Append "E:\Redirected\Tmp\Logs" -Loglevel:6' -Wait
Start-Process -FilePath $PSScriptRoot\2\Setup.exe -ArgumentList '-s -clean -noreboot -noeula -Append "E:\Redirected\Tmp\Logs" -Loglevel:6' -Wait
}
Else {
Write-Host "Running in a VM or display adapter is a NVIDIA Geforce or NVIDIA Graphics Driver v471.68 already installed! Exiting."
}
And … did you see the message you output inside your if block when you run the script? Did both of the installation executables start? Did you check the installation log?
Please keep in mind we cannot see your screen and we cannot read your mind.
Hi…
If I run line by line it will work but not the script.
Start-Process -FilePath $PSScriptRoot\Quadro\setup.exe -ArgumentList ‘-s -clean -noreboot -noeula -Append “E:\Redirected\Tmp\Logs” -Loglevel:6’ -Wait
Some installation programs used to start child processes right after they’ve got started and terminate themselfs immediately after that. So the calling process - PowerShell - thinks the program exited regularily and moves on the the next command.
If that’s the case you will have to figure out what child processes get started and monitore them until they exit before you can move on the the next command.