Use Start-Process
with the -PassThru
argument like this:
$app = Start-Process notepad -passthru
Wait-Process $app.Id
More Related Contents:
- How do I capture the output into a variable from an external process in PowerShell?
- String handling from Powershell script
- Use PowerShell to run virus scan on multiple servers
- Unable to access UNC Paths in Powershell remote session
- PowerShell script to check an application that’s locking a file?
- Lambda Expression in Powershell
- How do I write a PowerShell script that accepts pipeline input?
- How do I Start a job of a function i just defined?
- PowerShell: Unable to find type when using PS 5 classes
- Pass object[] into a function in PowerShell
- Prompt for user input in PowerShell
- Powershell output column width
- Delete all files and folders but exclude a subfolder
- Add Write-Progress to Get-Job/Wait-Job
- Powershell with exchange– How do I append all verbose output to a file
- How to handle command-line arguments in PowerShell
- How to send email with PowerShell
- How to split string by string in Powershell
- Powershell: Colon in commandlet parameters
- Passing PowerShell variables into a script block
- Why is $false -eq “” true?
- Check if a file exists or not in Windows PowerShell?
- Variable scoping in PowerShell
- Create Outlook email draft using PowerShell
- Read a Csv file with powershell and capture corresponding data
- Using –% in PowerShell
- List hidden sub-directories and sizes
- Are the cmdlets in a pipeline executing in parallel?
- PS Script is exporting an empty CSVs
- Drag and Drop to a Powershell script