Learn about Windows PowerShell
Summary: Use Windows PowerShell to create a file share.
How can I use Windows PowerShell on my computer running Windows 8 to create a new file share?
Open the Windows PowerShell console with Admin rights, then use the New-SmbShare function, and specify a file name and path:
New-SmbShare -Name fso -Path c:\fso
The term 'New-SmbShare' is not recognized as the name of a cmdlet... Windows 7 in a 2008 R2 Domain using UNC for the path. \\server\drive$\folder
Ed, That's because you can't use a UNC path. You are creating a share, not accessing one.
The term 'new-smbshare' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:1 char:13+ new-smbshare + CategoryInfo : ObjectNotFound: (new-smbshare:String) , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundExceptionWhat module is needed?
Cl, you're likely using the wrong OS/PS version. Amazingly if you google the cmdlet name the official technet documentation will give you the information you need: Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2.
Robin, it would be "amazingly" helpful if you just provided the answer instead of telling people to use Google. It just saves the extra step and keeps the answer in one place.
Alas "Google" told me that I cannot use New-SmbShare on Windows Server 2008 r2 or Windows 7.
There was a link to this article instead:
Although it did seem slightly incomplete.
New-SmbShare -Name fso -Path c:\fso if i adapt it to my script i get the error message: Access denied
KSchlichtherle, right-click powershell and runas Administrator.