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
1 answer

Powershell - Looking for a better way to check if multple processes have completed

I've got a script that creates some processes using the Start-Process command. There could be hundreds of processes running. The script works just fine, but I'm hoping someone can provide me with a more elegant way to check if the processes I…
Paul Wasserman
  • 137
  • 2
  • 13
0
votes
2 answers

Powershell wait until after file download to continue script

$x = Invoke-RestMethod -Method "Get" -uri $url -Headers $get_headers **Start-Process "chrome.exe" $x.url** Start-Sleep -s 10 Hello, I am using the above to download a file via chrome. Is it possible to wait until the file download is complete to…
Alex
  • 5
  • 1
  • 2
  • 3
0
votes
1 answer

Powershell can't read my variable as start-process file path

I'm trying to cleanup my script and I have ran into this issue. When I run Invoke-Command -ComputerName $Computer -ScriptBlock {Start-Process "c:\temp\openVPN\openvpn-install-2.4.8-I602-Win7.exe" I get no issues but when I set a variable so that…
user9905812
0
votes
1 answer

Start-Process fails to start the service

I'm a newbie to powershell. I am working on a script which is not starting the service intermittently. $sensuresult = Start-Process -Wait -FilePath $filepath -ArgumentList '/tasks="assocfiles,modpath" /quiet' -PassThru Basically here we are trying…
Ashwin
  • 439
  • 1
  • 7
  • 23
0
votes
0 answers

Powershell - Correct file path defined, but Start-Process tries to navigate from application location

I saw this answer below, and had implemented something similar. However, whenever I start Notepad++ I receive an error that the file cannot be opened due to that file not existing. I will point out I am attempting to do this from the Root of C.…
0
votes
1 answer

Enter password automatically for Sn.exe using powershell

I am trying to install pfx file automatically every time the Azure Pipeline runs, because with interactive process agent the files seems to loose the password or its just unable to import. Below is the powershell script i am trying to implement with…
suprasad
  • 1,411
  • 3
  • 18
  • 40
0
votes
0 answers

Referencing 5 random URL`s from a file of 50 URL`s and automatically opening all 5 in a browser. Repeated every 5 mins

Overview: Have around 50 websites in work, all URL`s have been added to a CSV file. We want a selection of 5 random sites to pop up in a web browser every 5 minutes and using a browser tab rotator to rotate through all 5 web pages. Browser closes,…
0
votes
1 answer

How to launch a loadtest run from command line in powershell?

I need to be able to launch a loadtest run using powershell Currently, using below code $test = "D:\LPT\abc.loadtest" $fs = New-Object -ComObject Scripting.FileSystemObject $f = $fs.GetFile("C:\Program Files (x86)\Microsoft Visual Studio…
Anu7
  • 77
  • 1
  • 17
0
votes
2 answers

Need to Search an csv file and run an if/Where statement on the value to initialize a bat file

Want to clear my cache once the system memory usage exceeds 70% I have a task scheduler to start monitoring, a data collection for the performance log with report exported to csv, a custom event view to trigger the clearing, and a bat file to clear…
Andrew
  • 3
  • 2
0
votes
1 answer

Running Wusa.exe /uninstall with Start-Process not working

I have been trying to uninstall an update via powershell. I am trying to leverage wusa.exe using start-process. When i pass the uninstall and quiet switches it fails to run. I get this error in setup event logs: Windows update could not be…
0
votes
1 answer

batch file command to powershell command

I have a following batch(.bat file) command which is working great. However, i need to convert it into powershell command and need to run it through powershell. I have went through different ways that i have found online but none of them seems to…
vishal
  • 5
  • 1
0
votes
1 answer

Powershell script to change users and launch another script

I have a script called ADInfo.ps1 that is used to query AD using the ActiveDirectory module in Powershell. In order to run the script, you must be running Powershell as an AD user. This is not an issue with most of our customers as we log into…
Christopher Cass
  • 817
  • 4
  • 19
  • 31
0
votes
0 answers

ArgumentList for silent install .Net 4.7.2

Attempting to silently install .Net 4.7.2 on a remote machine using Invoke-Command but no matter what type of parameters I've tried I keep getting... Invoke-Command : Parameter set cannot be resolved using the specified named parameters. I've…
titant3ch
  • 81
  • 8
0
votes
2 answers

using array within foreach statement powershell

I have an array containing folders I need to run a command on application for each of the folder, so I am using foreach command. However within the argument list, I need to specify path to each folder separately, so let's say I have 4 folders…
0
votes
1 answer

Powershell Start-Process on shared drive

I am trying to run a .msi that is in a network folder on my local machine. If I do it this way it means that I only have to update the file in one spot. The issue I run into is that I keep getting invalid username/password errors. I put in…