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

Start-Process hangs when used with -Credential

During my continuous delivery pipeline I would like to run Powershell script which starts my .NET Core application used to update database. Problem is user used TFS agent has no permissions to connect to MSSQL server. That's why I would like to run…
Paweł Hemperek
  • 1,130
  • 10
  • 21
0
votes
1 answer

Remove a file using powershell through admin account

Brief summary of what I'm trying to do. I have a script in powershell that takes 2 files and reads in the embedded credentials and stores them in a variable to which then I can run administrative commands from. This works great, however, after the…
Koobah84
  • 185
  • 2
  • 12
0
votes
2 answers

How to pass Windows credential in a PowerShell script?

I am writing a PS script to open a URL automatically in a Chrome browser. I created a credential object and pass it to Start-Process as below. $username = Read-Host 'What is your username?' $password = Read-Host 'What is your password?'…
0
votes
1 answer

How to set install options for remote software installation with powershell?

I'm attempting to install anaconda (using the 'Anaconda3-5.2.0-Windows-x86_64.exe' installer) on a large number of remote windows 10 PCs. I've installed software remotely before, but always using the default options. With this install I…
0
votes
2 answers

Limit number of Start-Process running in powershell

I have tried to limit the number of Start-Process running from a Powershell, but I can't seem to get it to work. I tried to follow this process: https://exchange12rocks.org/2015/05/24/how-to-limit-a-number-of-powershell-jobs-running-simultaneously/…
markb
  • 1,100
  • 1
  • 15
  • 40
0
votes
3 answers

Powershell start-process Runspace wont start except with -noexit flag

So i wrote this little GUI with Runspaces. it works as expected when running it in ISE, and if i start it from a PS prompt, but when i try to run it from a Shortcut it just wont boot as long as i dont use the -noexit flag. but when using the -noexit…
0
votes
1 answer

Detaching process from powershell hosted in C# application

We have a C# application that executes PowerShell scripts as an extension point, we don't have access to change this code but it is pretty much the following: string command = @"C:\temp.ps1"; var fileName = "powershell"; var args =…
Kevin Smith
  • 13,746
  • 4
  • 52
  • 77
0
votes
1 answer

Copy-item runas Administrator to program file fail

i would like to copy the license folder and overwrite the existing folder, since it is program file (x86), i have to run the elevated powershell, i am able to copy it when i launch it manually, just wonder is it possible to get all run at one line…
0
votes
1 answer

Using PowerShell to start batch file for secure wipe USB drive

I'm using PowerShell to start a bat file that wipes a USB drive that connected. If I use the script without Start-Process it works fine, but I'm wanting to connect multiple drives and have it wipe them simultaneously. The script: Register-WmiEvent…
Michael
  • 57
  • 1
  • 11
0
votes
1 answer

Powershell: No output to console when running Start-Process in an Invoke-Command scriptblock

I have the following (part of a) script, which is executed from TeamCity. try { $result = Invoke-Command -Session $session –ScriptBlock { Param ( [String] $serviceName )…
0
votes
0 answers

PowerShell Start Process not working when calling from Remote Machine

I am trying to execute the following powershell script from a Remote machine. It is working fine when running the script locally. I am able to see the notepad, when I execute it from remote machine, I am not able to see any notepad.exe process in…
Chandru M
  • 133
  • 1
  • 7
0
votes
1 answer

Cmd batch file executes only partly when using task scheduler

I have task scheduled a batch file to run at midnight. It has highest privileges, It is ran as administrator with a stored password, independent of whether the user is logged in or not The environment is set to windows 2012 The batch file's folder…
0
votes
1 answer

Powershell Open text file print it on exit

I have a text file that I need to open in Notepad.exe and have the user add some input to it. Then I would like to print the file to AdobePDF when the user exits the file. Here is what I have to open the file Start-Process notepad.exe…
Eric
  • 863
  • 4
  • 17
  • 31
0
votes
1 answer

Powershell Start-Process to run another Powershell script with more history

Using Start-Process I can call another powershell script within my powershell script. e.g. Start-Process powershell -argument '.\Another.ps1 The issue is the new Window only has a limited amount of history (i.e. scroll back up to see what was…
user1589188
  • 5,316
  • 17
  • 67
  • 130
0
votes
1 answer

Running Spigot BuildTools.jar from PowerShell using Git Bash

I'm trying to write a PowerShell script to update Spigot using Git Bash. Hopefully from the two failed PS examples below you get the gist of what I'm trying to do. I can successfully open a Git Bash shell in the target folder and run java -jar…
Chrisbot
  • 67
  • 4