Powershell n00b在这里。我想使用PowerShell挂载iso。我成功做到了:
PS C:\> PowerShell Mount-DiskImage C:\3D_Ultra_Pinball_Thrillride\pinball-disc.iso
Attached : True
BlockSize : 0
DevicePath : \\.\CDROM2
FileSize : 214403072
ImagePath : C:\3D_Ultra_Pinball_Thrillride\pinball-disc.iso
LogicalSectorSize : 2048
Number : 2
Size : 214403072
StorageType : 1
PSComputerName :
但是现在我想做一个在文件名中带有括号的文件,像这样:
PS C:\> PowerShell Mount-DiskImage "C:\Program Files (x86)\Warcraft III\warcraft-disc.iso"
x86 : The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:35
+ Mount-DiskImage C:\Program Files (x86)\Warcraft III\warcraft-disc.iso
+ ~~~
+ CategoryInfo : ObjectNotFound: (x86:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如何逃脱括号?反引号似乎无效,也不用单引号或双引号引起引用。
单引号使它成为字符串文字,并且应该可以正常工作。为什么在powershell提示中调用powershell?也许这就是问题所在。
PS C:\> Mount-DiskImage 'C:\Program Files (x86)\Common Files\SLI_3.0.0_A00 (1).iso'
Attached : True
BlockSize : 0
DevicePath : \\.\CDROM1
FileSize : 1882193920
ImagePath : C:\Program Files (x86)\Common Files\SLI_3.0.0_A00 (1).iso
LogicalSectorSize : 2048
Number : 1
Size : 1882193920
StorageType : 1
PSComputerName :
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句