Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbachecks compatibility with PowerShell Core (on Linux) #620

Open
gbuczylowski opened this issue May 29, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@gbuczylowski
Copy link

commented May 29, 2019

Any plans to make dbachecks compatible with PowerShell Core?

I'm running dbatools in docker Linux container with PowerShell Core, and it would be great to be able to run dbachecks as well.

@SQLDBAWithABeard

This comment has been minimized.

Copy link
Collaborator

commented May 29, 2019

Yes, that is definitely something on the roadmap.

Now if only someone can invent 48 hours in a day or clone me (or give me the energy of Chrissy! :-) )

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

SQLDBAWithABeard added a commit that referenced this issue May 31, 2019

@SQLDBAWithABeard

This comment has been minimized.

Copy link
Collaborator

commented May 31, 2019

It imports
image

Invoke-DbcCheck runs
Instance, Agent and Database checks run
Update-DbcPowerBi runs
image

Export and Import Config runs
image

Copy the json to the correct path on windows and it opens in powerbi
image

image

@SQLDBAWithABeard

This comment has been minimized.

Copy link
Collaborator

commented May 31, 2019

Still some things to do

Will it run against on Linux against a windows machine?

The other checks files will need to be checked

Other commands need to be checked

Hmm - I could do some of that

Get-DbcCheck works
image

Get-DbcConfig works

image

Get-DbcConfigValue works

@SQLDBAWithABeard

This comment has been minimized.

Copy link
Collaborator

commented May 31, 2019

image

Set-DbcConfig works

image

Set-DbcConfig -Append works

image

Reset-DbcConfig gives warnings from PSFramework but does appear to work

image

image

@SQLDBAWithABeard

This comment has been minimized.

Copy link
Collaborator

commented May 31, 2019

and the tests pass :-)

Feel free to clone the development branch (because I am stupid and thought I was on a new branch locally which I had created) and test

by loading the module from the psd1

Import-Module PATHTOLOCALREPOOFDBACHECKS\dbachecks.psd1

@gbuczylowski

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

I've run some tests against SQL in Windows container, and the module loads just fine, but some tests fail to load assertion files due to incorrect case.

Since Linux is case-sensitive and all assertion files are in Pascal Case, they need to be loaded from .test.ps1 files with the right case.

e.g.
../dbachecks/checks/Agent.Tests.ps1 loads Agent.assertions.ps1 in line 2, but the actual file name is Agent.Assertions.ps1, which only causes issues in Linux

. $PSScriptRoot/../internal/assertions/Agent.assertions.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.