Revoke All Permissions From Folder Share

Get-SmbShareAccess -name $ShareName | Foreach {Revoke-SmbShareAccess -name $ShareName  -AccountName $_.AccountName -Force}
Details
Gets all the permissions for the share, then revokes them.

Example
PS C:\> $ShareName='ScriptFiles

>> Get-SmbShareAccess -name $ShareName | Foreach {Revoke-SmbShareAccess -name $ShareName  -AccountName $_.AccountName -Force}


Name                    ScopeName               AccountName             AccessControlType       AccessRight
----                    ---------               -----------             -----------------       -----------
ScriptFiles$            *                       NT AUTHORITY\SYSTEM     Allow                   Full
ScriptFiles$            *                       *S-1-5-5-0-158796760    Allow                   Read
ScriptFiles$            *                       *S-1-5-5-0-158796760    Allow                   Read
ScriptFiles$            *                       Everyone                Deny                    Full