0

省略敏感数据。

我无法让 PowerShell 连接到共享文件夹。 Copy-Item : Cannot find path '\\192.168.0.000\Common Data\Software\Crystal Reports\CRRedist2005_X64.msi' because it does not exist.

这确实适用于一台机器,但不适用于另一台机器。

$source = "\\192.168.0.000\Common Data\Software\Crystal Reports\CRRedist2005_X64.msi"
Copy-Item $source -Destination $env:USERPROFILE\Downloads -Verbose

这在任何一台机器上都不起作用

Copy-Item "\\192.168.0.000\Common Data\Software\Crystal Reports\CRRedist2005_X64.msi" -Destination $env:USERPROFILE\Downloads -Verbose

我试过使用 New-PSDrive 方法

    New-PSDrive -Name S -Root "\\192.168.0.000\Common Data\" -PSProvider FileSystem
Copy-Item "S:\Software\Crystal Reports\CRRedist2005_X64.msi" -Destination $env:USERPROFILE\Downloads -Verbose

The specified drive root "\\192.168.0.000\Common Data\" either does not exist, or it is not a folder.

FileSystem:: 也给出了未找到的路径

Copy-Item "FileSystem::\\192.168.0.000\Common Data\Software\Crystal Reports\CRRedist2005_X64.msi" -Destination $env:USERPROFILE\Downloads -verbose

如果我将地址复制到文件资源管理器中,它就没有问题。

我要疯了,想弄清楚为什么它不起作用。

编辑:重新映射驱动器,它可以在第二台计算机上运行。

4

0 回答 0