Created
September 10, 2021 19:09
-
-
Save JacobBennett/50687548750a3ba68b5832eee42b7fdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$CustomPaths = @( | |
@{Name = "Cubs"; Path = "C:\cubs"; Exclude = @('*.txt', '*.pdf')}, | |
@{Name = "Cubs"; Path = "C:\cubs"; Exclude = @('*.txt', '*.pdf')}, | |
@{Name = "Cubs"; Path = "C:\cubs"; Exclude = @('*.txt', '*.pdf')}, | |
@{Name = "Cubs"; Path = "C:\cubs"; Exclude = @('*.txt', '*.pdf')}, | |
) | |
# Handle Mapping all the custom values | |
forEach ($Location in $CustomPaths) { | |
# Create File Group | |
New-FsrmFileGroup $Location.Name -IncludePatten $MonitoredExtensions -ExcludePattern $Location.Exclude | |
# Create Custom File Screen Template | |
New-FsrmFileScreenTemplate $Location.Name -IncludeGroup:$Location.Name -Notification $EmailNotification,$EventNotification,$Command -Active | |
# Create Custom File Screen | |
New-FsrmFileScreen -Path $Location.Path -template:$Location.Name | |
} | |
$drivesContainingShares = @(Get-WmiObject Win32_Share | | |
Select Path, Type | | |
Whre-Object { $_.Type -match '0'} | | |
Where-Object ( $_.Path -notin $CustomPaths.Path) | | |
Select -ExpandPropety Path | | |
Select -Unique) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment