Hello,
I am a little bit stuck at comparing multiple files and folders.
We have 4 UNC paths and all files and folders must me exact (because of App-V 5 SCS)
Now we would like to compare these folders if all files and folders are exact.
We had a script and local it worked good.
But de server name is variable.
For example:
\\ServerA\scs$\App-V App\
\\ServerB\scs$\App-V App\
\\ServerC\scs$\App-V App\
\\ServerD\scs$\App-V App\
We created $FolderA to $FolderD and used the following script
Foreach($File in Get-ChildItem -Recurse -Path $FolderA | Where {$_.psIsContainer -eq $False} | Select-Object Name)
{$File=$File.name
if (!(Test-Path "$FolderB\$File"))
{Write-Output "Missing File: $FolderB\$File"}
}
When we run this script is looked it worked local. Because C:\ is the same at every check.
But running this with an UNC path he looks at ServerA till ServerD so always different and alwas incorrect.
Is there a way to exclude the first lines so we can get a exact check for files and folders?
Hope everything is clear what I mean with this and thanks in advance!