Add PodeFileWatcher - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: FileWatchers schema: 2.0.0
Adds a new File Watcher to monitor file changes in a directory.
Add-PodeFileWatcher [-Name <String>] [-EventName <String[]>] -Path <String> -ScriptBlock <ScriptBlock>
[-ArgumentList <Object[]>] [-NotifyFilter <NotifyFilters[]>] [-Exclude <String[]>] [-Include <String[]>]
[-InternalBufferSize <Int32>] [-NoSubdirectories] [-PassThru] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Add-PodeFileWatcher [-Name <String>] [-EventName <String[]>] -Path <String> -FilePath <String>
[-ArgumentList <Object[]>] [-NotifyFilter <NotifyFilters[]>] [-Exclude <String[]>] [-Include <String[]>]
[-InternalBufferSize <Int32>] [-NoSubdirectories] [-PassThru] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Adds a new File Watcher to monitor file changes in a directory.
Add-PodeFileWatcher -Path 'C:/Projects/:project/src' -Include '*.ps1' -ScriptBlock {}
Add-PodeFileWatcher -Path 'C:/Websites/:site' -Include '*.config' -EventName Changed -ScriptBlock {}
Add-PodeFileWatcher -Path '/temp/logs' -EventName Created -NotifyFilter CreationTime -ScriptBlock {}
$watcher = Add-PodeFileWatcher -Path '/temp/logs' -Exclude *.txt -ScriptBlock {} -PassThru
A hashtable of arguments to supply to the File Watcher's ScriptBlock.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional EventName to be monitored. Note: '*' refers to all event names. (Default: Changed, Created, Deleted, Renamed)
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: @('Changed', 'Created', 'Deleted', 'Renamed')
Accept pipeline input: False
Accept wildcard characters: FalseAn optional array of file patterns to be excluded.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA literal, or relative, path to a file containing a ScriptBlock for the File Watcher's logic.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional array of file patterns to be included. (Default: .)
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: *.*
Accept pipeline input: False
Accept wildcard characters: FalseThe InternalBufferSize of the file monitor, used when temporarily storing events. (Default: 8kb)
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 8192
Accept pipeline input: False
Accept wildcard characters: FalseAn optional Name for the File Watcher. (Default: GUID)
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the File Watcher will only monitor files in the specified directory path, and not in all sub-directories as well.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe attributes on files to monitor and notify about. (Default: FileName, DirectoryName, LastWrite, CreationTime)
Type: NotifyFilters[]
Parameter Sets: (All)
Aliases:
Accepted values: FileName, DirectoryName, Attributes, Size, LastWrite, LastAccess, CreationTime, Security
Required: False
Position: Named
Default value: @('FileName', 'DirectoryName', 'LastWrite', 'CreationTime')
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the File Watcher object registered will be returned.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe Path to a directory which contains the files to be monitored.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe ScriptBlock defining logic to be run when events are triggered.
Type: ScriptBlock
Parameter Sets: Script
Aliases:
Required: True
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.