I am trying to define an array of file paths that I can loop over and apply user permissions to. Some of these paths have spaces in them, and the way I'm trying to define the array variable, I cannot loop over them.
$rootSitePath = "C:\Path"
$paths = $rootSitePath + "\" + "Path1",
$rootSitePath + "\" + "Path with spaces",
$rootSitePath = "\" + "Path3"
foreach($path in $paths)
{
#do stuff
}
Not sure if I need to escape in a certain way??