Skip to content

Commit aea4fce

Browse files
authored
Merge pull request #8891 from ssemyan/patch-1
Remove trailing empty argument in ContainerCommand
2 parents 1dc3cef + 6b92f2e commit aea4fce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ContainerInstance/ContainerInstance/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed issue in the -Command parameter of New-AzContainerGroup which added a trailing empty argument
2223

2324
## Version 1.0.0
2425
* General availability of `Az.ContainerInstance` module
25-
* Added managed identity support
26+
* Added managed identity support

src/ContainerInstance/ContainerInstance/Commands/NewAzureContainerGroupCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public override void ExecuteCmdlet()
263263
{
264264
throw new ArgumentException($"Invalid 'Command' parameter: {string.Join("; ", errors.Select(err => err.Message))}");
265265
}
266-
creationParameter.ContainerCommand = tokens.Select(token => token.Text.Trim('\'', '"')).ToList();
266+
creationParameter.ContainerCommand = tokens.Select(token => token.Text.Trim('\'', '"')).Where(token => !string.IsNullOrEmpty(token)).ToList();
267267
}
268268

269269
creationParameter.Validate();

0 commit comments

Comments
 (0)