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

OSOE-156: Code styling #63

Merged
merged 14 commits into from
Oct 6, 2022
Merged

OSOE-156: Code styling #63

merged 14 commits into from
Oct 6, 2022

Conversation

Piedone
Copy link
Member

@Piedone Piedone commented Oct 6, 2022

@0liver
Copy link
Contributor

0liver commented Oct 6, 2022

What an adventure!

@Piedone
Copy link
Member Author

Piedone commented Oct 6, 2022

It was a huge waste of time fighting with the peculiarities of how splatting works.

@0liver
Copy link
Contributor

0liver commented Oct 6, 2022

You might have been able to test that locally - not the docker command, just the argument splatting.

Anyway, you are smarter now! 🎉

It's probably worth sharing this hard-won knowledge in our wiki on some PS specific page.

@Piedone
Copy link
Member Author

Piedone commented Oct 6, 2022

I did what I can locally, but most of the stuff was related to Docker (under Ubuntu). I'll add this to the wiki.

@sarahelsaig
Copy link
Member

You don't have to test it with docker tho.
image

@Piedone
Copy link
Member Author

Piedone commented Oct 6, 2022

That's what I thought, but hash table-based splatting doesn't work with anything non-PS. Array-based splitting does, but I could get that right in one go, after spending half an hour figuring out why hash table-based splatting won't work the same as with a PS script.

@sarahelsaig
Copy link
Member

You can see from my screenshot that splatting a hash table prepends the keys with a single dash. So I wouldn't expect it to work with docker that expects longform arguments to have the GNU style double dashes.

@Piedone
Copy link
Member Author

Piedone commented Oct 6, 2022

That's what I did, except for --name it does need double dashes too. This code with this build is where I had to give up hash tables.

But please let's not waste any more time on this whole thing.

@sarahelsaig
Copy link
Member

What you linked actually results in docker run ---name sql2019 --env 'ACCEPT_EULA=Y SA_PASSWORD=Password1!' --publish '1433:1433' --detach 'mcr.microsoft.com/mssql/server:2019-latest'. Note the triple dash. Like I said, splatting a table prepends one dash to the key. It's a real misstep from Microsoft because if it prepended double dash then it would be more compatible.
image

It appears that you've given up right before removing the final double dash from your hash table.
image

@Piedone
Copy link
Member Author

Piedone commented Oct 6, 2022

/sad :(.

@0liver 0liver merged commit baf3316 into dev Oct 6, 2022
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

Successfully merging this pull request may close these issues.

3 participants