Questions tagged [start-process]

Start-Process is a PowerShell cmdlet that starts one or more processes on the local computer.

Start-Process is a PowerShell cmdlet that starts one or more processes on the local computer. To specify the program that runs in the process, enter an executable file or script file, or a file that can be opened by using a program on the computer. If you specify a non-executable file, Start-Process starts the program that is associated with the file, much like the Invoke-Item cmdlet.

You can use the parameters of Start-Process to specify options, such as loading a user profile, starting the process in a new window, or using alternate credentials.

Output

  • None or System.Diagnostics.Process
    When you use the PassThru parameter, Start-Process generates a System.Diagnostics.Process. Otherwise, this cmdlet does not return any output.
255 questions
0
votes
0 answers

Powershell: start multiple processes and put them in a list and observe them

i want to create some Powershellscript where i can add a uncertain number of processes to a list. After that i want to observe, if the processes are finished. so i created this: $procs = New-Object -TypeName 'System.Collections.ArrayList'; $procs…
0
votes
0 answers

Cant use -Credential when using "Start-Process" in Powershell

I want to execute a .exe File with the Start-Process Command while using specific credentials. However I cant get it to work for me: $username = "" $password = "" $secPassword = ConvertTo-SecureString $password…
Z0rumi
  • 1
  • 1
0
votes
0 answers

Powershell Onedrive uninstall script, file not found

I'm trying to make a powershell script to uninstall Onedrive from users computers by running Invoke-Command -computername computer1 -filepath script.ps1 but i keep getting issues with the last step. The first function "doUninstall" works just fine,…
0
votes
0 answers

Specifying FilePath in Start-Process

I'm trying to boot up a localhost for some GitHub code I've cloned. I am getting the message: cmdlet Start-Process at command pipeline position 1 Supply values for the following parameters: FilePath: Followed by this error when I type…
0
votes
1 answer

Install setup.exe in PowerShell with Arguments

I have to install a Exe file silently I only have access to the devices via powershell. The installer will ask for a serial number and path can this be done in PowerShell I have tried below with the silent command removed but it still prompts for…
0
votes
0 answers

Powershell Error: Cannot validate argument on parameter 'FilePath'. The argument is null or empty

I am trying to test the uninstallation of a program that is installed on my device. I am not sure what I need to do to specify the file path to this exe located on my device. Eventually this will need to be deployed organization wide, that's why I…
0
votes
0 answers

PowerShell: How to pass correctly parameter to new PS instance run by Start-Process

Hello stackoverflow team, please could You assist on following question: How to pass correctly parameter to new PS instance run by Start-Process using arguments or ideally parameters. I have found only one ugly way interpreting-concatenating string…
Kubator
  • 1,373
  • 4
  • 13
0
votes
1 answer

PowerShell, Start an app hidden in background, then kill that app

An app I want to push to various systems (Notepad++) doesn't generate it's configuration file until after it starts, so I'd like to start the application quickly hidden in the background so that the config.xml is generated (grabbing the apps PID as…
YorSubs
  • 3,194
  • 7
  • 37
  • 60
0
votes
0 answers

PowerShell, Difference between Start-Job and a hidden Start-Process that calls powershell.exe

I can use Start-Job to run a process in the background for asynchronous / parallel jobs. However, I could also use something like the following with Start-Process which gives me other options for an asynchronous background process. $command =…
0
votes
2 answers

Powershell start-process hidden wmplayer file with spaces

powershell Start-Process -WindowStyle Hidden 'C:\Program Files\Windows Media Player\wmplayer.exe' c:\windows\media\notify.wav run ok. powershell Start-Process -WindowStyle Hidden 'C:\Program Files\Windows Media Player\wmplayer.exe'…
wyxchari
  • 66
  • 3
0
votes
0 answers

python3.0 winrm powershell script start-process can not start process

use python3.10 winrm to run powershell script remotely, the start-process command can not start tsm.exe process, is some wrong in below code? could someone help me to check this ,thank you ip_item='10.12.62.23' ps_script_tsm=""" Start-Process …
0
votes
1 answer

How can I run a pipeline with variables in a background task in Powershell?

I'm trying to run two large sort processes simultaneously. So far, I've been unable to run one of these processes in the background. Here's what I'm doing: Get-Content $attfile |Sort-Object { [datetime]::ParseExact($_.Substring(0, 23),…
0
votes
1 answer

Powershell Script: Wait-Process called with array of processes throws an exception due to invalid argument

I am trying to run multiple processes and then wait in the script for their execution to terminate. However, when calling $procs | Wait-Process an exception is thrown. $SCRIPT_PATH = "path/to/Program.exe" $procs = Get-ChildItem -Path $DIR |…
SimpleThings
  • 147
  • 2
  • 12
0
votes
1 answer

Converting from Start-process to System.Diagnostics.Process

We have working powershell script ran through start-process $EncodedCommand =…
0
votes
1 answer

Pass complex arguments to powershell script through encoded command

I want to run nested powershell script block, with complex type arguments. I want to pass parameters to powershell scriptblock trough encoded command and encoded arguments. I`m trying this script. $text = "This is a test message." $Cred =…