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

[FR] Export-DbcConfig - add option to create folders if they don't exist #1019

Open
MikeyBronowski opened this issue Nov 6, 2023 · 0 comments

Comments

@MikeyBronowski
Copy link
Contributor

Feature Request

<-- Simply answer the question - What would you like dbachecks to do that it doesn't? -->

Current behaviour

Export-DbcConfig -Path C:\Tools\PowerDBA\dbachecks_config.txt -Force
Out-File: Could not find a part of the path 'C:\Tools\PowerDBA\dbachecks_config.json'.

New requested behaviour

Use the new switch to create the folder structure first: -CreatePath, -ForceCreate or whatevs

Export-DbcConfig -Path C:\Tools\PowerDBA\dbachecks_config.txt -Force -CreatePath

Add something like New-Item when the switch is enabled.

Get-DbcConfig |
 Select-Object * |
 ConvertTo-Json -Depth 10 |
 Out-File ( New-Item -FilePath $Path -Force ) -Force -ErrorAction Stop

https://github.com/dataplat/dbachecks/blob/6b633310b71ff982ae5dd9b8658308e0cf7d6daf/source/functions/Export-DbcConfig.ps1#L54C9-L54C9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant