Open michele-tahay-kohera opened 1 month ago
Oh, in case you should wonder, it is the same thing with the other installed instance (sql 2022)
As it is a local instance - do you run the command from an elevated PowerShell session? This should be needed to get to the registry.
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
When running this command, you don't get results but also not any error as well
Get-DbaHideInstance -SqlInstance localhost\namedInstance1
You do get an error when you call it with the -EnableException parameter:![image](https://github.com/dataplat/dbatools/assets/62601152/1b798975-1b5a-4dbd-a2de-42c5b0d860eb)
The registry item is there all right, and my powershell session is running in admin mode![image](https://github.com/dataplat/dbatools/assets/62601152/6b820354-a16e-4a45-9f16-f8b91eef3247)
It is possible that it is a permission issue, but then it should clearly state so in a warning/error message.
Steps to Reproduce
Get-DbaHideInstance -SqlInstance localhost\namedInstance1
Please confirm that you are running the most recent version of dbatools
2.1.14
Other details or mentions
I'm trying to test out dbachecks on my local machine with 2 (almost empty) named instances. This dbatools command is used in the check "HideInstance", and when it is included it doesn't fail but makes another test fail ("LoginPasswordExpiration") with a message "We Could not Connecto to $Instance"
What PowerShell host was used when producing this error
VS Code (integrated terminal)
PowerShell Host Version
Name Value
PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2506
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server Edition and Build number
Microsoft SQL Server 2019 (RTM-GDR) (KB5035434) - 15.0.2110.4 (X64) Mar 12 2024 18:25:56 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 22631: ) (Hypervisor)
.NET Framework Version
.NET Framework 4.8.9181.0