proxb / PowerShell_Scripts

Miscellaneous scripts for things that I have done; more scripts will arrive as I get time to update this repo.
MIT License
205 stars 72 forks source link

strange behaviour in case of cluster #4

Closed chipitsine closed 8 years ago

chipitsine commented 8 years ago

hello,

I'm running various instances of ms sql (including database engine, reporting, analysis, ...),

I was getting the following exception:

You cannot call a method on a null-valued expression.
At C:\xxx\Get-SQLInstance.ps1:185 char:25
+                         $PropertyHash['Version'] = $instanceRegSetup.GetValue('V ...
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

I added some debug: https://github.com/chipitsine/PowerShell_Scripts/blob/master/Get-SQLInstance.ps1#L182

here's more detailed exception

computer: SRV-SQL01-DCA
file: "C:\Program Files\Microsoft SQL Server\MSAS11.DEV_DCA\OLAP\bin\msmdsrv.exe" -s "H:\OLAP\Config"
service: "C:\Program Files\Microsoft SQL Server\MSAS11.DEV_DCA\OLAP\bin\msmdsrv.exe" -s "H:\OLAP\Config"
Something went wrong...
System.ArgumentException
Illegal characters in path.
You cannot call a method on a null-valued expression.
At C:\xxx\Get-SQLInstance.ps1:198 char:25
+                         $PropertyHash['Version'] = $instanceRegSetup.GetValue('V ...
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

it seems, script does not expect MSAS ?

proxb commented 8 years ago

That is very possible and I didn't have MSAS available during the time that I wrote the script. I may have to spin it up and do some testing...or if you want to fix it and submit a PR, that would work as well :)

chipitsine commented 8 years ago

I submitted a PR. it resolves situation with cluster. I'll take a look at standalone MSAS installation a bit later

chipitsine commented 8 years ago

it works as expected in case of standalone server as well

proxb commented 8 years ago

Thanks! I've approved the PR.