...
Start-JobSchedulerExecutableFile
SYNOPSIS
Starts the specified an executable file with parameters optionally for a different user account.
...
Runs the specified executable file in the context of a different user account.
The cmdlet reads credentials from the Windows Credential Manager, i.e. credentials
that have previously been added by the Windows command "cmdkey" or any other credential management tools.
Credentials are indicated by their "target" name " which represents the identifier by which
credentials are retrieved.
By default a user profile is considered. The -NoLoadUserProfile parameter prevents using a profile.
The cmdlet returns a [System.Diagnostics.Process] object that includes additional properties:
* By default
** output to stdout is available with the "StandardOutputContent" property.
** output to stderr is available with the "StandardErrorContent" property.
* With the parameters -NoStandardOutput and -NoStandardError respectively being used
** output to stdout is available from a temporary file that is indicated with the "StandardOutputFile" property.
** output to stderr is available from a temporary file that is indicated with the "StandardErrorFile" property.
* An exit code is not reliably reported if the cmdlet is used from an unprivileged account
to start a process for a different user
PARAMETERS
Path
-Path <String>
Specifies the full path and name of the executable file to be started. Executable files includes binary files (.com, .exe)
and command scripts (.cmd, .bat) etc..
Required? | true |
Position? | 1 |
Default value | |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
...
Required? | false |
Position? | 2 |
Default value | |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
...
Required? | false |
Position? | 3 |
Default value | |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
...
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
...
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
...
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | falsetrue (ByPropertyName) |
Accept wildcard characters? | false |
RELATED LINKS
EXAMPLES
-------------------------- EXAMPLE 1 --------------------------
PS > $process = Start-JobSchedulerExecutableFile -Path 'c:/tmp/powershell/sample_script.cmd' -TargetName 'localhostrun_as_ap'
Runs the command script for the account that is specified with the credentials identified by the target name. The resulting process object includes the properties * $process.StandardOutputContent * $process.StandardErrorContent that contain the output that is created to stdout and stderr.
...
PS > $process = Start-JobSchedulerExecutableFile -Path 'c:/tmp/powershell/sample_script.cmd' -TargetName 'localhostrun_as_ap' -NoStandardOutput -NoStandardError
...