Add-Type @”
using System;
using System.Runtime.InteropServices;
public class MountPoint
{
[DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool DeleteVolumeMountPoint(string mountPoint);
}
“@
[MountPoint]::DeleteVolumeMountPoint(“G:\”)
Is it possible to do it more simple, for example with WMI?
Sorry, I’m new in PowerShell