The requirements for this procedure is:
1) You have created a Share. My share name is PS.
2) You are using Windows 8 or higher. This gives you access to the Storage module.
3) You are logged in with elevated credentials.
Set-SMBShare -Name PS -CachingMode None -Confirm:$False
The -Name parameter is the name of the share to to action on.
-CachingMode has 5 potential values:
-- None: Prevents users from storing documents and programs offline.
-- Manual: Allows users to identify the documents and programs that they want
to store offline.
-- Programs: Automatically stores documents and programs offline.
-- Documents: Automatically stores documents offline.
-- BranchCache: Enables BranchCache and manual caching of documents on the
The -Confirm:$False is used to suppress the confirmation prompt.