Skip to content

support match settings for windows - #607

Merged
a-murphy merged 2 commits into
Shippable:masterfrom
trriplejay:master
Oct 26, 2018
Merged

support match settings for windows#607
a-murphy merged 2 commits into
Shippable:masterfrom
trriplejay:master

Conversation

@trriplejay

Copy link
Copy Markdown
Contributor

}

if ($match_settings -and !$canMatchSettings) {
Write-Output "Warning: -match_settings flag not supported for the specified resources."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only be a log? The user has asked for something that we cannot comply with. I feel like this should throw an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, if we can't do what they ask it makes more sense to fail.

$toTagsExcept = $toVersionData.version.propertyBag.tags.except
if ($toTagsOnly -and $toTagsOnly.Count -gt 0 ) {
$matchedTag = $false
foreach ($tag in $toTagsOnly) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm playing "code golf" here, but you could check $tags.Where({$_ -like $tag}).Count and get rid of the manual looping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I'm not familiar enough with ps to know these kinds of things, but that shaves off a decent number of lines while maintaining readability.

@trriplejay
trriplejay force-pushed the master branch 2 times, most recently from 820edcf to 1849863 Compare October 26, 2018 17:51
@a-murphy
a-murphy merged commit 14e9a69 into Shippable:master Oct 26, 2018
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