Skip to content

Instantly share code, notes, and snippets.

@JacobBennett
Created September 10, 2021 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobBennett/50687548750a3ba68b5832eee42b7fdb to your computer and use it in GitHub Desktop.
Save JacobBennett/50687548750a3ba68b5832eee42b7fdb to your computer and use it in GitHub Desktop.
$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