PATH - The mandatory PATH parameter should contain the local or network path to the user's home folder. Drive letters and UNC formatted paths are accepted. A typical path would look like \\servername\sharename\user.
USER - The mandatory USER parameter should contain the username of the home folder owner. It's best to format the input with the FQDN, but the parameter accepts simple usernames as well. A typical user would look like "MyCompany\Bob", but entering "Bob" will also work in most cases.
ACCESS - The optional parameter ACCESS allows you to change the file system rights from the default "MODIFY" to another selection. Other common selections include "READ", "WRITE", "FULLCONTROL". For more information on this topic, see this Technet article: Link
FORCE - The optional FORCE parameter modifies the default behavior of the script and allows you to apply user file system rights to an existing folder. Without this, you are not able to apply user permissions to existing folders.
- PS C:\> .\New-Home.ps1 -Path \\Srv1\Home\Bob -User "test.local\Bob"
This example creates a new folder on a file server and assigns the user "Modify" permissions, which includes read, write, execute, list folder contents, and a few others.
- PS C:\> .\New-Home.ps1 -Path \\Srv1\Home\Bob -User "test.local\Bob" -Force
This is the same example with the addition of the Force switch. The folder already exists, so the script grants Bob permissions to the folder. Without Force, it would have failed with a "Destination folder already exists" exception.
- PS C:\> .\New-Home.ps1 -Path \\Srv1\Home\Bob -User "test.local\Bob" -Access "FullControl"
This example creates a new folder on a file server and assigns Bob "FullControl" permissions.