|
| 1 | +$tlist = Import-CSV TypeComparison.csv |
| 2 | +@' |
| 3 | +# PowerShell Standard Library 5 |
| 4 | +
|
| 5 | +'@ |
| 6 | + |
| 7 | +$unavailableHeader = @' |
| 8 | +## Unavailable Types |
| 9 | +
|
| 10 | +There are a number of types which while exist in both PowerShell 5.1 and PowerShell 6, have been excluded from PowerShell Standard 5. |
| 11 | +The following lists the reason for exclusion and types excluded from PowerShell Standard 5. |
| 12 | +
|
| 13 | +'@ |
| 14 | + |
| 15 | +$unavailableTypes = $tlist |Where-Object {$_.PowerShell51 -eq "True" -and $_.PowerShell61 -eq "True" -and $_.PSStandard5 -eq "False"} |
| 16 | + |
| 17 | +$unavailableHeader |
| 18 | +$unavailableTypes | Sort-Object ExclusionReason | Group-Object ExclusionReason | %{ |
| 19 | + " - {0}" -f $_.Name |
| 20 | + $_.Group | %{ " - {0}" -f $_.FullName } |
| 21 | +} |
| 22 | + |
| 23 | +$urlBase = "https://docs.microsoft.com/en-us/dotnet/api/" |
| 24 | +$view = "view=pscore-6.0.0" |
| 25 | +$command = "Microsoft.PowerShell.Commands.DisablePSRemotingCommand" |
| 26 | + |
| 27 | +$availableTypes = $tlist |Where-Object {$_.PSStandard5 -eq "True"} |
| 28 | +$groupedTypes = $availableTypes | group { $fragments = $_.fullname.split("."); $fragments[0..($fragments.count - 2)] -join "." } |
| 29 | + |
| 30 | +$typelistHeader = @' |
| 31 | +
|
| 32 | +## Available Types |
| 33 | +
|
| 34 | +The following table is a table of available types in PowerShell Standard by Namespace with links to online documentation. |
| 35 | +
|
| 36 | +'@ |
| 37 | + |
| 38 | +$ColumnCount = 2 |
| 39 | +$emptyCell = "<td> </td>" |
| 40 | +$typelistHeader |
| 41 | +"<table>" |
| 42 | +$groupedTypes | %{ |
| 43 | + $name = $_.name |
| 44 | + # Sigh - no way to span columns in markdown |
| 45 | + "" |
| 46 | + "<tr><th valign='bottom' height='50' align='left' colspan='${ColumnCount}'>${name}</th></tr>" |
| 47 | + $group = $_.group |
| 48 | + # $gTypes = @($_.group | %{$_.fullname.split(".")[-1] }) |
| 49 | + for($i = 0; $i -lt $group.Count; $i += ${ColumnCount} ) { |
| 50 | + $t = $group[$i..($i+${columnCount}-1)] | %{ |
| 51 | + $fullname = $_.fullname -replace "``","-" # " |
| 52 | + $name = $fullname.split(".")[-1] |
| 53 | + "<td><a href='${urlBase}${fullname}?${view}'>${name}</a></td>" |
| 54 | + } |
| 55 | + # pad the collection |
| 56 | + $addlCellCount = ${ColumnCount} - @($t).Count |
| 57 | + if ( $addlCellCount -gt 0 ) { |
| 58 | + $t += @($emptyCell) * $addlCellCount |
| 59 | + } |
| 60 | + "<tr>" + ($t -join "") + "</tr>" |
| 61 | + } |
| 62 | +} |
| 63 | +"</table>" |
| 64 | +"" |
0 commit comments