Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<Compile Remove="commands\utility\ShowCommand\ShowCommandParameterSetInfo.cs" />
<Compile Remove="commands\utility\ShowCommand\ShowCommandParameterType.cs" />
<Compile Remove="commands\utility\ShowCommand\ShowCommandProxy.cs" />
<Compile Remove="commands\utility\update-list.cs" />
<Compile Remove="singleshell\installer\MshUtilityMshSnapin.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\BasicHtmlWebResponseObject.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\ContentHelper.FullClr.cs" />
Expand All @@ -48,7 +47,6 @@
<Compile Remove="gen\FormatAndOut_out_gridview.cs" />
<Compile Remove="gen\UtilityMshSnapinResources.cs" />
<Compile Remove="gen\OutPrinterDisplayStrings.cs" />
<Compile Remove="gen\UpdateListStrings.cs" />
<Compile Remove="gen\ConvertFromStringResources.cs" />
<Compile Remove="gen\ConvertStringResources.cs" />
<Compile Remove="gen\FlashExtractStrings.cs" />
Expand All @@ -57,7 +55,6 @@
<EmbeddedResource Remove="resources\FormatAndOut_out_gridview.resx" />
<EmbeddedResource Remove="resources\UtilityMshSnapinResources.resx" />
<EmbeddedResource Remove="resources\OutPrinterDisplayStrings.resx" />
<EmbeddedResource Remove="resources\UpdateListStrings.resx" />
<EmbeddedResource Remove="resources\ConvertFromStringResources.resx" />
<EmbeddedResource Remove="resources\ConvertStringResources.resx" />
<EmbeddedResource Remove="resources\FlashExtractStrings.resx" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CmdletsToExport= "Format-List", "Format-Custom", "Format-Table", "Format-Wide",
"Get-Alias", "Get-Culture", "Get-Date", "Get-Host", "Get-Member", "Get-Random", "Get-UICulture",
"Get-Unique", "Export-PSSession", "Import-PSSession", "Import-Alias", "Import-LocalizedData",
"Select-String", "Measure-Object", "New-Alias", "New-TimeSpan", "Read-Host", "Set-Alias", "Set-Date",
"Start-Sleep", "Tee-Object", "Measure-Command", "Update-TypeData", "Update-FormatData",
"Start-Sleep", "Tee-Object", "Measure-Command", "Update-TypeData", "Update-FormatData", "Update-List",
"Remove-TypeData", "Get-TypeData", "Write-Host", "Write-Progress", "New-Object", "Select-Object",
"Group-Object", "Sort-Object", "Get-Variable", "New-Variable", "Set-Variable", "Remove-Variable",
"Clear-Variable", "Export-Clixml", "Import-Clixml", "Import-PowerShellDataFile", "ConvertTo-Xml", "Select-Xml", "Write-Debug",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CmdletsToExport= "Format-List", "Format-Custom", "Format-Table", "Format-Wide",
"Get-Alias", "Get-Culture", "Get-Date", "Get-Host", "Get-Member", "Get-Random", "Get-UICulture",
"Get-Unique", "Export-PSSession", "Import-PSSession", "Import-Alias", "Import-LocalizedData",
"Select-String", "Measure-Object", "New-Alias", "New-TimeSpan", "Read-Host", "Set-Alias", "Set-Date",
"Start-Sleep", "Tee-Object", "Measure-Command", "Update-TypeData", "Update-FormatData",
"Start-Sleep", "Tee-Object", "Measure-Command", "Update-TypeData", "Update-FormatData", "Update-List",
"Remove-TypeData", "Get-TypeData", "Write-Host", "Write-Progress", "New-Object", "Select-Object",
"Group-Object", "Sort-Object", "Get-Variable", "New-Variable", "Set-Variable", "Remove-Variable",
"Clear-Variable", "Export-Clixml", "Import-Clixml", "Import-PowerShellDataFile","ConvertTo-Xml", "Select-Xml", "Write-Debug",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Describe "Update-List tests" -Tags CI {
BeforeEach {
$list = [System.Collections.Generic.List[int]]::new()
$list.Add(1)
$list.Add(2)
$list.Add(3)
$obj = [PSCustomObject]@{list = $list}
}

It "Can use -Add" {
$newobj = $obj | Update-List -Property list -Add 4,5
[string]::Join(",", $newobj.List) | Should Be "1,2,3,4,5"
}

It "Can use -Remove" {
$newobj = $obj | Update-List -Property list -Remove 2
[string]::Join(",", $newObj.List) | Should Be "1,3"
}

It "Can use both -Add and -Remove" {
$newobj = $obj | Update-List -Property list -Add 6,7 -Remove 1,3
[string]::Join(",", $newobj.List) | Should Be "2,6,7"
}

It "Can use -Replace" {
$newobj = $obj | Update-List -Property list -Replace 4,5,6
[string]::Join(",", $newobj.List) | Should Be "4,5,6"
}
}
2 changes: 1 addition & 1 deletion test/powershell/engine/Basic/DefaultCommands.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Cmdlet", "Unregister-PSSessionConfiguration", , $($FullCLR -or $CoreWindows -or $CoreUnix)
"Cmdlet", "Update-FormatData", , $($FullCLR -or $CoreWindows -or $CoreUnix)
"Cmdlet", "Update-Help", , $($FullCLR -or $CoreWindows -or $CoreUnix)
"Cmdlet", "Update-List", , $($FullCLR )
"Cmdlet", "Update-List", , $($FullCLR -or $CoreWindows -or $CoreUnix)
"Cmdlet", "Update-TypeData", , $($FullCLR -or $CoreWindows -or $CoreUnix)
"Cmdlet", "Use-Transaction", , $($FullCLR )
"Cmdlet", "Wait-Debugger", , $($FullCLR -or $CoreWindows -or $CoreUnix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $excludeList = "CoreMshSnapinResources.resx",
"FormatAndOut_out_gridview.resx",
"UtilityMshSnapinResources.resx",
"OutPrinterDisplayStrings.resx",
"UpdateListStrings.resx",
"ConvertFromStringResources.resx",
"ConvertStringResources.resx",
"FlashExtractStrings.resx",
Expand Down