I'm working on a PowerShell script to add a File Server Resource Monitor file screen to each drive in the server. We deal with lots of servers that have any number of drives. What I want to accomplish is holding each drive letter as a variable and then later, spitting those out to apply the file screens.
Here is what I have so far:
$DiskArray= Get-Volume | Select DriveLetter
I then need to add :\
to the end of each drive letter.
From working with FSRM, I see that a new file screen would need to be created for each drive, since you can only add one path. Here is the line I use to manually create a file screen.
New-FsrmFileScreen -path "E:\" -template "Test Template"
I would then like to repeat this line for every drive, the path being C:\, D:\, E:\, F:\ and so on.
Any help would be greatly appreciated.