【问题标题】:Mount Point in PowerShellPowerShell 中的挂载点
【发布时间】:2012-07-18 17:42:06
【问题描述】:

我正在尝试使用 Powershell 创建挂载点。它是在本地完成的,这是我遇到的代码和问题。

$choice = "t"
New-Item -ItemType directory -Path "E:\Data\Riptide\Ariis\Ris\Docs\interPrimary1\"
$orgdrive = "E:\Data\Riptide\Ariis\Ris\Docs\interPrimary1\"
$driveLetter= $Choice + ":\"
$driveinfo=get-wmiobject win32_volume | where { $_.driveletter -eq $choice + ":" } | select-object DeviceID
Mountvol $orgdrive $driveinfo

执行时,我得到参数不正确。

提前致谢。

【问题讨论】:

    标签: powershell mount-point


    【解决方案1】:

    你只需要尝试一下:

    mountvol $orgdrive $driveinfo.DeviceID
    

    未来你可以测试:

    $driveinfo| Get-Member
    

    您可以找到here 一个可以让您测试命令行参数的工具。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-19
      • 2022-12-18
      • 2013-10-31
      • 1970-01-01
      • 2022-11-03
      • 2017-04-22
      • 1970-01-01
      相关资源
      最近更新 更多