| external help file | PSRemoteOperations-help.xml |
|---|---|
| Module Name | PSRemoteOperations |
| online version | http://bit.ly/2KsBuGc |
| schema | 2.0.0 |
Create the default PSRemoteOperation watcher.
Register-PSRemoteOperationWatcher [[-Name] <String>] [-Minutes <Int32>] [-Path <String>] [-ArchivePath <String>] [-Credential <PSCredential>] [-ScheduledJobOption <ScheduledJobOptions>] [-WhatIf] [-Confirm] [<CommonParameters>]The premise of PSRemoteOperations is that the computer is monitoring a folder looking for a file that begins with its computer name. Once a file has been identified, it can be passed to Invoke-PSRemoteOperation to execute. You may use whatever mechanism or techniques you'd like to monitor the PSRemoteOperation path. Or you can use this command to setup a PowerShell scheduled job to monitor the folder and invoke files as they are detected. The default behavior is to create a watcher that checks every 5 minutes for matching files. The scheduled job repeats indefinitely and will survive reboots. Use the scheduled job cmdlets to manage or remove.
You will need to re-enter your credentials.
NOTE: This command only exists on Windows platforms that support PowerShell Scheduled Jobs.
PS C:\> Register-PSRemoteOperationWatcher -name Watch
Id Name JobTriggers Command Enabled
-- ---- ----------- ------- -------
11 Watch 1 ... TrueCreate a scheduled job called Watch. This job is using the user-defined defaults for $PSRemoteOpPath and $PSRemoteOpArchive. It is also using the default time interval of 5 minutes.
PS C:\> Unregister-Scheduledjob watchUse the PowerShell scheduled job cmdlets to remove the watcher job.
Enter the path of the folder to use for the remote operations archive.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $PSRemoteOpArchive
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseEnter your username and credentials.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe number of minutes to pause between checking for new files. Enter a value between 5 and 1440.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 5
Accept pipeline input: False
Accept wildcard characters: FalseThe name of your scheduled job.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: RemoteOpWatcher
Accept pipeline input: False
Accept wildcard characters: FalseEnter the path of the folder to watch.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $PSRemoteOpPath
Accept pipeline input: False
Accept wildcard characters: FalseA job option object created with New-ScheduledJobOption.
Type: ScheduledJobOptions
Parameter Sets: (All)
Aliases: Option
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis 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).
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/