Skip to content

Commit cde05d4

Browse files
committed
Change build to .NET 6.0 to use PS7.2 to remove ANSI from string properties
1 parent dfb2523 commit cde05d4

File tree

10 files changed

+22
-30
lines changed

10 files changed

+22
-30
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
12-
"program": "${workspaceFolder}/Cmdlet/bin/Debug/netcoreapp3.0/win10-x64/OutGridViewCmdlet.dll",
12+
"program": "${workspaceFolder}/Cmdlet/bin/Debug/net6.0/win10-x64/OutGridViewCmdlet.dll",
1313
"args": [],
1414
"cwd": "${workspaceFolder}/Cmdlet",
1515
"console": "internalConsole",
@@ -20,7 +20,7 @@
2020
"type": "coreclr",
2121
"request": "launch",
2222
"preLaunchTask": "build",
23-
"program": "${workspaceFolder}/Application/bin/Debug/netcoreapp3.0/win10-x64/OutGridViewApplication.dll",
23+
"program": "${workspaceFolder}/Application/bin/Debug/net6.0/win10-x64/OutGridViewApplication.dll",
2424
"args": [],
2525
"cwd": "${workspaceFolder}/Application",
2626
"console": "internalConsole",

GraphicalTools.build.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ param(
33
[ValidateSet("Debug", "Release")]
44
[string]$Configuration = "Debug",
55

6-
[string[]]$ModuleName = @(
7-
"Microsoft.PowerShell.GraphicalTools",
8-
"Microsoft.PowerShell.ConsoleGuiTools" )
6+
[string[]]$ModuleName = @(
7+
#"Microsoft.PowerShell.GraphicalTools",
8+
"Microsoft.PowerShell.ConsoleGuiTools" )
99
)
1010

1111
$script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core" -and !$IsWindows
1212

13-
$script:TargetFramework = "netcoreapp3.0"
13+
$script:TargetFramework = "net6.0"
1414
$script:RequiredSdkVersion = (Get-Content (Join-Path $PSScriptRoot 'global.json') | ConvertFrom-Json).sdk.version
1515

1616
$script:ModuleLayouts = @{}
@@ -152,12 +152,12 @@ task LayoutModule -After Build {
152152
foreach ($projectName in $moduleLayout.NativeBuildAssets.Keys) {
153153
foreach ($targetPlatform in $moduleLayout.NativeBuildAssets[$projectName]) {
154154
$destDir = Join-Path $moduleBinPath $projectName $targetPlatform
155-
155+
156156
$null = New-Item -Force $destDir -Type Directory
157-
157+
158158
# Get the project build dir path
159159
$publishPath = [System.IO.Path]::Combine($PSScriptRoot, 'src', $projectName, 'bin', $Configuration, $script:TargetFramework, $targetPlatform, "publish\*" )
160-
160+
161161
Write-Host $publishPath
162162
# Binplace the asset
163163
Copy-Item -Recurse -Force $publishPath $destDir

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "3.1.102"
3+
"version": "6.0.100"
44
}
55
}

src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\GraphicalTools.Common.props" />
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Nstack.Core" Version="0.16.0" />
9-
<PackageReference Include="Terminal.Gui" Version="1.0" />
10-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.1" />
8+
<PackageReference Include="Nstack.Core" Version="0.17.*" />
9+
<PackageReference Include="Terminal.Gui" Version="1.6.*" />
10+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.*" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Copyright = '(c) Microsoft Corporation.'
3030
Description = 'Cross-platform Console Gui Tools for PowerShell'
3131

3232
# Minimum version of the PowerShell engine required by this module
33-
PowerShellVersion = '6.2'
33+
PowerShellVersion = '7.2'
3434

3535
# Name of the PowerShell host required by this module
3636
# PowerShellHostName = ''

src/Microsoft.PowerShell.ConsoleGuiTools/OutConsoleGridviewCmdletCommand.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ baseObject is PSReference ||
111111
ThrowTerminatingError(error);
112112
}
113113

114-
// Remove any potential ANSI escape codes from strings
115-
foeach (var property in input.Properties)
116-
{
117-
if (property.Value is string)
118-
{
119-
var stringDecorated = new StringDecorated(property.Value as string);
120-
property.Value = stringDecorated.ToString(OutputRendering.PlainText);
121-
}
122-
}
123-
124114
_psObjects.Add(input);
125115
}
126116

src/Microsoft.PowerShell.ConsoleGuiTools/TypeGetter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Management.Automation;
6+
using System.Management.Automation.Internal;
67
using System.Linq;
78
using System.Globalization;
89
using System.Collections.Generic;
@@ -26,7 +27,7 @@ public FormatViewDefinition GetFormatViewDefinitionForObject(PSObject obj)
2627
var types = _cmdlet.InvokeCommand.InvokeScript(@"Microsoft.PowerShell.Utility\Get-FormatData " + typeName).ToList();
2728

2829
//No custom type definitions found - try the PowerShell specific format data
29-
if (types == null || types.Count == 0)
30+
if (types == null || types.Count == 0)
3031
{
3132
types = _cmdlet.InvokeCommand
3233
.InvokeScript(@"Microsoft.PowerShell.Utility\Get-FormatData -PowerShellVersion $PSVersionTable.PSVersion " + typeName).ToList();
@@ -62,7 +63,8 @@ public DataTableRow CastObjectToDataTableRow(PSObject ps, List<DataTableColumn>
6263
}
6364
else
6465
{
65-
valuePairs[dataColumn.ToString()] = new StringValue { DisplayValue = stringValue };
66+
var stringDecorated = new StringDecorated(stringValue);
67+
valuePairs[dataColumn.ToString()] = new StringValue { DisplayValue = stringDecorated.ToString(OutputRendering.PlainText) };
6668
}
6769
}
6870

src/Microsoft.PowerShell.GraphicalTools/Microsoft.PowerShell.GraphicalTools.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\GraphicalTools.Common.props" />
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\GraphicalTools.Common.props" />
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />

src/OutGridView.Gui/OutGridView.Gui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\GraphicalTools.Common.props" />
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>
88
<Folder Include="Models\" />

0 commit comments

Comments
 (0)