Delete a Network Shared Drive (SMB Share) to enable files for remote access.
#Remove Network Shared Drive Confirmation requested Remove-SmbShare -Name "MyShare"
PS C:\> Confirm Are you sure you want to perform this action? Performing operation 'Remove-Share' on Target '*,MyShare'. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
#To avoid confirmation use parameter -force Remove-SmbShare -Name "MyShare" -Force
PS C:\> << This command doesn't return information >>
Windows 8+ / Windows Server 2012 R2
How to create Network Shared Drive:
New-SmbShare ::: Command reference: https://docs.microsoft.com/en-us/powershell/module/smbshare/new-smbshare
Remove-SmbShare ::: Command refrence: https://docs.microsoft.com/en-us/powershell/module/smbshare/remove-smbshare