Skip to content

Instantly share code, notes, and snippets.

@jakerobinson
Created January 22, 2020 22:02
Show Gist options
  • Save jakerobinson/6a1ef0fb193c1eb2727a354959401d18 to your computer and use it in GitHub Desktop.
Save jakerobinson/6a1ef0fb193c1eb2727a354959401d18 to your computer and use it in GitHub Desktop.
function New-VsanDirectory {
param (
$datastore,
$name
)
$serviceInstance = Get-View ServiceInstance
$datastoreNamespaceMgr = Get-View $serviceInstance.Content.DatastoreNamespaceManager
$folderPath = $datastoreNamespaceMgr.createDirectory($datastore.ExtensionData.moref,$name,"")
$folderPath.split("/")[-1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment