【发布时间】:2019-10-28 14:19:06
【问题描述】:
当我在 Azure Cloud Shell 中打开 Bash 时,我能够创建和编辑新文件和目录。
但是当我尝试在 Azure Cloud Shell 的 PowerShell 版本中执行此操作时,我无法执行任何这些操作。
例如,当我尝试创建一个新文件时:
Azure:/
PS Azure:\> new-item -Type file -Path my_new_files.txt
new-item : The node at path 'AzurePSDrive#Azure/my_new_files.txt' does not support the cmdlet 'New-Item'
At line:1 char:1
+ new-item -Type file -Path my_new_files.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (AzurePSDrive#Azure/my_new_files.txt:String) [New-Item], NodeDoesNotSupportCmdletException
+ FullyQualifiedErrorId : NewItem.NotSupported,Microsoft.PowerShell.Commands.NewItemCommand
当我尝试 cd 进入我已经从 Bash shell 创建的目录时:
Azure:/
PS Azure:\> ls
clouddrive jjj jjj.txt
Azure:/
PS Azure:\> cd jjj
cd : Cannot find path 'Azure:/jjj' because it does not exist.
At line:1 char:1
+ cd jjj
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (Azure:/jjj:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
为什么我可以在 Bash 中 mkdir、touch、cd 和 vi,但似乎没有文件/目录命令在 PowerShell 中有效?
【问题讨论】:
标签: azure