|
| 1 | +--- |
| 2 | +external help file: PSRemoteOperations-help.xml |
| 3 | +Module Name: PSRemoteOperations |
| 4 | +online version: https://github.com/jdhitsolutions/PSRemoteOperations/blob/master/docs/Wait-PSRemoteOperation.md |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Wait-PSRemoteOperation |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | + |
| 12 | +Wait for a PSRemoteOperation to complete. |
| 13 | + |
| 14 | +## SYNTAX |
| 15 | + |
| 16 | +### folder (Default) |
| 17 | + |
| 18 | +```yaml |
| 19 | +Wait-PSRemoteOperation [-Path <String>] [-Computername <String>] [-Timeout <Int32>] [<CommonParameters>] |
| 20 | +``` |
| 21 | + |
| 22 | +### file |
| 23 | + |
| 24 | +```yaml |
| 25 | +Wait-PSRemoteOperation [[-FilePath] <String>] [-Timeout <Int32>] [<CommonParameters>] |
| 26 | +``` |
| 27 | + |
| 28 | +## DESCRIPTION |
| 29 | + |
| 30 | +Most of the time remote operations are intended to be run asynchronously in much the same way that you use Start-Job. But there my be situations where you want to wait for a remote operation to complete. This command will pause your PowerShell prompt until the job completes or a timeout value has been exceeded. |
| 31 | + |
| 32 | +This command does not write any results to the pipeline. |
| 33 | + |
| 34 | +## EXAMPLES |
| 35 | + |
| 36 | +### Example 1 |
| 37 | + |
| 38 | +```powershell |
| 39 | +PS C:\> New-PSRemoteOperation -scriptblock { get-process | export-clixml c:\shared\proc.xml} -computername SRV1 -passthru | Wait-PSRemoteOperation |
| 40 | +``` |
| 41 | + |
| 42 | +This example will create a new PSRemote operation which passes the resulting .psd1 file to Wait-PSRemoteOperation. |
| 43 | + |
| 44 | +### Example 2 |
| 45 | + |
| 46 | +```powershell |
| 47 | +PS C:\> Wait-PSRemoteOperation -computername SRV2 -timeout 30 |
| 48 | +``` |
| 49 | + |
| 50 | +Watch the $PSRemoteOpPath folder for a job targeted to SRV2 but timeout waiting after 30 seconds. |
| 51 | + |
| 52 | +## PARAMETERS |
| 53 | + |
| 54 | +### -Computername |
| 55 | + |
| 56 | +Wait for results from a specific computer |
| 57 | + |
| 58 | +```yaml |
| 59 | +Type: String |
| 60 | +Parameter Sets: folder |
| 61 | +Aliases: cn |
| 62 | + |
| 63 | +Required: False |
| 64 | +Position: Named |
| 65 | +Default value: None |
| 66 | +Accept pipeline input: False |
| 67 | +Accept wildcard characters: False |
| 68 | +``` |
| 69 | +
|
| 70 | +### -FilePath |
| 71 | +
|
| 72 | +Specify the path to a PSRemoteOperation file. |
| 73 | +
|
| 74 | +```yaml |
| 75 | +Type: String |
| 76 | +Parameter Sets: file |
| 77 | +Aliases: fullname |
| 78 | + |
| 79 | +Required: False |
| 80 | +Position: 0 |
| 81 | +Default value: None |
| 82 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 83 | +Accept wildcard characters: False |
| 84 | +``` |
| 85 | +
|
| 86 | +### -Path |
| 87 | +
|
| 88 | +This should be the value of $PSRemoteOpPath |
| 89 | +
|
| 90 | +```yaml |
| 91 | +Type: String |
| 92 | +Parameter Sets: folder |
| 93 | +Aliases: |
| 94 | + |
| 95 | +Required: False |
| 96 | +Position: Named |
| 97 | +Default value: $PSRemoteOpPath |
| 98 | +Accept pipeline input: False |
| 99 | +Accept wildcard characters: False |
| 100 | +``` |
| 101 | +
|
| 102 | +### -Timeout |
| 103 | +
|
| 104 | +Specify a timeout value in seconds between 5 and 300. |
| 105 | +
|
| 106 | +```yaml |
| 107 | +Type: Int32 |
| 108 | +Parameter Sets: (All) |
| 109 | +Aliases: |
| 110 | + |
| 111 | +Required: False |
| 112 | +Position: Named |
| 113 | +Default value: None |
| 114 | +Accept pipeline input: False |
| 115 | +Accept wildcard characters: False |
| 116 | +``` |
| 117 | +
|
| 118 | +### CommonParameters |
| 119 | +
|
| 120 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 121 | +
|
| 122 | +## INPUTS |
| 123 | +
|
| 124 | +### System.String |
| 125 | +
|
| 126 | +## OUTPUTS |
| 127 | +
|
| 128 | +### None |
| 129 | +
|
| 130 | +## NOTES |
| 131 | +
|
| 132 | +Learn more about PowerShell: |
| 133 | +http://jdhitsolutions.com/blog/essential-powershell-resources/ |
| 134 | +
|
| 135 | +## RELATED LINKS |
| 136 | +
|
| 137 | +[New-PSRemoteOperation](./New-PSRemoteOperation.md) |
0 commit comments