Skip to content
Merged
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 @@ -33,12 +33,10 @@
<Compile Remove="commands\utility\ShowCommand\ShowCommandParameterSetInfo.cs" />
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
Comment thread
SteveL-MSFT marked this conversation as resolved.
Resolved
<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="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 @@ -47,7 +45,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 @@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.Commands
/// (multi-valued parameter for a cmdlet), without exposing the list.
/// </summary>
[Cmdlet(VerbsData.Update, "List", DefaultParameterSetName = "AddRemoveSet",
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113447", RemotingCapability = RemotingCapability.None)]
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2109383", RemotingCapability = RemotingCapability.None)]
public class UpdateListCommand : PSCmdlet
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CmdletsToExport = @(
'Get-TraceSource', 'Set-TraceSource', 'Add-Type', 'Get-TypeData', 'Remove-TypeData', 'Update-TypeData',
'Get-UICulture', 'Get-Unique', 'Get-Uptime', 'Clear-Variable', 'Get-Variable', 'New-Variable',
'Remove-Variable', 'Set-Variable', 'Get-Verb', 'Write-Verbose', 'Write-Warning', 'Invoke-WebRequest',
'Format-Wide', 'ConvertTo-Xml', 'Select-Xml', 'Get-Error'
'Format-Wide', 'ConvertTo-Xml', 'Select-Xml', 'Get-Error', 'Update-List'
)
FunctionsToExport = @()
AliasesToExport = @('fhx')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CmdletsToExport = @(
'ConvertFrom-StringData', 'Format-Table', 'New-TemporaryFile', 'New-TimeSpan', 'Get-TraceSource', 'Set-TraceSource',
'Add-Type', 'Get-TypeData', 'Remove-TypeData', 'Update-TypeData', 'Get-UICulture', 'Get-Unique', 'Get-Uptime',
'Clear-Variable', 'Get-Variable', 'New-Variable', 'Remove-Variable', 'Set-Variable', 'Get-Verb', 'Write-Verbose',
'Write-Warning', 'Invoke-WebRequest', 'Format-Wide', 'ConvertTo-Xml', 'Select-Xml', 'Get-Error'
'Write-Warning', 'Invoke-WebRequest', 'Format-Wide', 'ConvertTo-Xml', 'Select-Xml', 'Get-Error', 'Update-List'
)
FunctionsToExport = @()
AliasesToExport = @('fhx')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

Describe "Update-List Tests" -Tag CI {
BeforeEach {
$testObj = [pscustomobject]@{a = [System.Collections.ArrayList]::new(@(1,2,3))}
}


It "-Add works" {
$testObj | Update-List -Property a -Add 4
$testObj.A | Should -Be 1,2,3,4
}

It "-Remove works" {
Update-List -InputObject $testObj -Property a -Remove 2
$testObj.A | Should -Be 1,3
}

It "-Add with -Remove works" {
$testObj | Update-List -Property a -Remove 2 -Add 4
$testObj.A | Should -Be 1,3,4
}

It "-Replace works" {
$testObj | Update-List -Property a -Replace 2,4
$testObj.A | Should -Be 2,4
}
}
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 @@ -475,7 +475,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Cmdlet", "Unregister-PSSessionConfiguration","", $($FullCLR -or $CoreWindows ), "", "", "Low"
"Cmdlet", "Update-FormatData", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Low"
"Cmdlet", "Update-Help", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium"
"Cmdlet", "Update-List", "", $($FullCLR ), "", "", ""
"Cmdlet", "Update-List", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None"
"Cmdlet", "Update-TypeData", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Low"
"Cmdlet", "Use-Transaction", "", $($FullCLR ), "", "", ""
"Cmdlet", "Wait-Debugger", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None"
Expand Down
2 changes: 1 addition & 1 deletion test/powershell/engine/Help/assets/HelpURI/V2Cmdlets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Undo-Transaction,https://go.microsoft.com/fwlink/?LinkID=135268
Unregister-Event,https://go.microsoft.com/fwlink/?LinkID=135269
Unregister-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144308
Update-FormatData,https://go.microsoft.com/fwlink/?LinkID=113420
Update-List,https://go.microsoft.com/fwlink/?LinkID=113447
Update-List,https://go.microsoft.com/fwlink/?LinkID=2109383
Update-TypeData,https://go.microsoft.com/fwlink/?LinkID=113421
Use-Transaction,https://go.microsoft.com/fwlink/?LinkID=135271
Wait-Event,https://go.microsoft.com/fwlink/?LinkID=135276
Expand Down