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
7 changes: 5 additions & 2 deletions ConvertFrom-XmlElement.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
[Parameter(ParameterSetName='SelectXmlInfo',Position=0,Mandatory=$true,ValueFromPipeline=$true)]
[Microsoft.PowerShell.Commands.SelectXmlInfo] $SelectXmlInfo,
# Only include attributes, ignore other child nodes.
[Alias('Attributes','Atts')][switch] $OnlyAttributes
[Alias('Attributes','Atts')][switch] $OnlyAttributes,
# Replace any simple element that only contains one other element with its child.
[Alias('CollapseSimple')][switch] $SimpleSuccession
)
Process
{
Expand All @@ -61,7 +63,8 @@
{
return $Element.InnerText
}
elseif(($Element.SelectNodes('*') |Group-Object Name |Measure-Object).Count -eq 1)
elseif($SimpleSuccession -and ($Element.Attributes.Count -eq 0) -and

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
(($Element.SelectNodes('*') |Group-Object Name |Measure-Object).Count -eq 1))
{
return @($Element.SelectNodes('*') |ConvertFrom-XmlElement.ps1)
}
Expand Down
4 changes: 3 additions & 1 deletion Export-MermaidXY.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Begin
End
{
$data = $input
$labels = $data |Select-Object -ExpandProperty $LabelProperty
$labels = $data |
Select-Object -ExpandProperty $LabelProperty |
ForEach-Object {$_ -match '\W' ? "`"$($_ -replace '"')`"" : $_}
$minmax = $LineProperty + $BarProperty |ForEach-Object {$data |Select-Object -ExpandProperty $_} |Measure-Object -Minimum -Maximum
$min = $minmax.Minimum -gt 0 ? 0 : $minmax.Minimum
$max = $minmax.Maximum
Expand Down
2 changes: 1 addition & 1 deletion Uninstall-OldModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Get-Module -ListAvailable |
Group-Object Name |
Where-Object Count -gt 1 |
ForEach-Object {$_.Group |Sort-Object Version -Descending |Select-Object -Skip 1} |
Where-Object {$PSCmdlet.ShouldProcess("$($_.Name) v$($_.Version)",'Uninstall-Module')} |
Where-Object {$Force -or $PSCmdlet.ShouldProcess("$($_.Name) v$($_.Version)",'Uninstall-Module')} |
ForEach-Object {Uninstall-Module $_.Name -RequiredVersion $_.Version -Force:$Force}
Loading