SQLServer 模块已安装,但未找到 SQLSERVER: 驱动器。

huangapple go评论81阅读模式
英文:

SQLServer module installed but SQLSERVER:\ drive not found

问题

我已在我的Windows机器上安装了SqlServer模块,没有出现任何问题。然而,当我尝试cd到SQLSERVER:\驱动器时,它说它不存在。我必须在SqlServer模块提供的函数上运行帮助,然后它似乎会进行一些隐式加载,允许我cd到SQLSERVER:\驱动器。这一切都是远程完成的(尽管我已尝试在远程桌面连接到该计算机后进行了测试,结果相同)。有没有办法修复这个解决方法?

运行Get-Module -Name SqlServer -ListAvailable返回:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     22.0.59    SQLServer                           {Add-RoleMember, Add-SqlAvailabilityDatabase, Add-SqlAvail...

但在运行帮助之前运行cd SQLSERVER:\返回:

cd : 无法找到驱动器。名为 'SQLSERVER' 的驱动器不存在。
英文:

I've installed the SqlServer module on my windows machine with no issues. However, when I try to cd into the SQLSERVER:\ drive, it says it does not exist. I have to run a help on a function provided by the SqlServer module, and THEN it seems to do some implicit loading which allows me to cd into the SQLSERVER:\ drive. This is all done remotely (though I've tried it after RDPing into the box with the same result). Is there a way to fix this workaround?

Running Get-Module -Name SqlServer -ListAvailable returns:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     22.0.59    SQLServer                           {Add-RoleMember, Add-SqlAvailabilityDatabase, Add-SqlAvail...

But running cd SQLSERVER:\ before I run a help returns:

cd : Cannot find drive. A drive with the name 'SQLSERVER' does not exist.

答案1

得分: 1

只需首先导入该模块。

英文:

Just import the module first

Import-Module SQLServer;

huangapple
  • 本文由 发表于 2023年6月5日 23:17:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407841.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定