I’m trying to count the contents of a folder on a remote server.
I know that:
Get-ChildItem \\ServerName\c$\foldername -recurse | Measure-Object -property length -sum
works a treat.
However I’m trying to make the server name a variable, by user input, but I can’t get the path to accept any variable.
It’s pretty straightforward: