This topic contains 4 replies, has 3 voices, and was last updated by
August 15, 2016 at 5:54 am #50408ParticipantPoints: 0Rank: Member
Does anyone know if there is a DSC resource for mount points? (handy for SQL Servers). I've requested the feature to be added to xDisk (https://github.com/PowerShell/xStorage/issues/47) but was hoping someone has already created something I could use in the meantime.
August 15, 2016 at 7:17 am #50412ParticipantPoints: -19Rank: Member
Haven't seen one.
I normally used MountVol in vbscripts and batch files to do the work on my SQL servers, but you can also achieve that with WMI code.
As always if you have code to do the job, you can wrap it in a script DSC component and create your own DSC.
Hope it will be added to xStorage as its a good needed addition.
August 31, 2016 at 1:45 pm #52694ParticipantPoints: 0Rank: Member
I wrote a custom resource do this for exchange. Just a part of my modified xstorage module. I can share the code if you're interested. Really should get around to setting up git ;). But basically I just have a wrapper function for diskpart, as far as i'm aware there isn't a powershell command to add mount points...could be wrong though.
August 31, 2016 at 5:33 pm #52786ParticipantPoints: -19Rank: Member
if you don't want to rely on diskpart or MountVol you can go directly to the Win32 api,
but apparently PowerShell does have cmdlets to deal with mount points.
Look at Add-PartitionAccessPath
September 2, 2016 at 4:44 am #53126ParticipantPoints: 0Rank: Member
@ryan, as Arie has said you can use Add-PartitionAccessPath to create a mount in Powershell. See example below.
$Disk = Get-Disk 2 $Disk | Initialize-Disk -PartitionStyle GPT $disk | New-Partition -UseMaximumSize -MbrType IFS $Partition = Get-Partition -DiskNumber $Disk.Number $Partition | Format-Volume -FileSystem NTFS -Confirm:$false $Partition | Add-PartitionAccessPath -AccessPath "C:\MyMounts\SQLData01"
PlagueHO has kindly offered to create xMountPoint. See https://github.com/PowerShell/xStorage/issues/47
I still would like to get hold of your custom resource. Any chance you could upload it to Github or even just a Gist?
The topic ‘DSC Resource for Mount Points’ is closed to new replies.