Powershell 运行 Get-dbaDatabase 搜索丢失的备份时出错
运行此命令时出现以下错误:
Get-dbaDatabase -sqlinstance server01 -NoFullBackup
错误:
Compare-DbaCollationSensitiveObject : Cannot bind argument to parameter 'Value' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.1.76\allcommands.ps1:22322 char:109
+ ... bject -Property Name -In -Value $lastCopyOnlyBackups.Database -Collat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Compare-DbaCollationSensitiveObject], ParameterBindingValidationExcept
ion
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Compare-DbaCollationSensitiveObject
这发生在 dbatools 的多个版本上,我认为它与 dbatools 根本无关。当我在另一个很久以前创建配置文件的帐户上运行此命令时,我没有收到任何错误。新的帐户配置文件似乎会出现此错误。我认为这可能与 PowerShell 中的设置有关,但我不确定它可能是什么。
在较旧的帐户配置文件上,该命令不返回任何内容,基本上是一个空行。较新的帐户都会返回此错误。我已在从 Windows Server 2012 到 Windows Server 2019 的计算机上运行此命令。
我确实尝试在新服务器上使用在旧服务器上工作的帐户,在这种情况下,我确实收到了上述错误。它似乎与创建配置文件的时间有关,这让我认为在组策略或计算机策略级别设置了一些默认设置或行为。
PowerShell 版本是 5.1。
我希望有一些 PowerShell 专家可以为我指明正确的方向。
谢谢!
I am getting the following error when running this command:
Get-dbaDatabase -sqlinstance server01 -NoFullBackup
Error:
Compare-DbaCollationSensitiveObject : Cannot bind argument to parameter 'Value' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.1.76\allcommands.ps1:22322 char:109
+ ... bject -Property Name -In -Value $lastCopyOnlyBackups.Database -Collat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Compare-DbaCollationSensitiveObject], ParameterBindingValidationExcept
ion
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Compare-DbaCollationSensitiveObject
This happens on multiple versions of dbatools, I don't think it is related to dbatools at all. When I run this on another account that has a profile created long ago I get no errors. New account profiles seem to have this error show up. I am thinking it may be related to a setting in PowerShell but I am not sure what it could be.
On an older account profile the command just returns nothing, basically a blank line. The newer accounts all return this error. I have run this command on machines ranging from Windows Server 2012 through Windows Server 2019.
I did try to use an account that worked on an older server on a new server and in that case I do get the error above. It seems to be related to when the profile was created, which makes me think there is some default setting or behavior that is being set at the group policy or machine policy level.
PowerShell version is 5.1.
I am hoping there are some PowerShell experts out there that can point me in the right direction.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
dbatools 团队已确认这是该函数中的一个错误。这是 2021 年末实现的相当新的功能。这应该会在 dbatools 的未来更新中得到修复。
This has been acknowledged as a bug in the function by the dbatools team. This is fairly new functionality that was implemented in late 2021. This should get fixed in a future update to dbatools.