Skip to content

Commit ac3b3fb

Browse files
authored
add support for running psedit in visual studio (#92)
add launch profiles for pwsh / powershell, so you can F5 run psedit from visual studio
1 parent f73b317 commit ac3b3fb

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Properties/launchSettings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"profiles": {
3+
"pwsh": {
4+
"commandName": "Executable",
5+
"executablePath": "pwsh",
6+
"commandLineArgs": "-NoExit -Command & { Import-Module .\\\\psedit.psd1; Show-PSEditor }",
7+
"workingDirectory": "$(ProjectDir)bin\\$(Configuration)\\$(TargetFramework)\\publish"
8+
},
9+
"powershell": {
10+
"commandName": "Executable",
11+
"executablePath": "powershell",
12+
"commandLineArgs": "-NoExit -Command & { Import-Module .\\\\psedit.psd1; Show-PSEditor }",
13+
"workingDirectory": "$(ProjectDir)bin\\$(Configuration)\\$(TargetFramework)\\publish"
14+
}
15+
}
16+
}

psedit.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
@@ -11,11 +11,12 @@
1111
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1212
<PackageReference Include="YamlDotNet" Version="16.3.0" />
1313
</ItemGroup>
14-
1514
<ItemGroup>
1615
<None Include="psedit.psd1">
1716
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1817
</None>
1918
</ItemGroup>
20-
19+
<Target Name="PublishForDebugging" AfterTargets="Build" Condition="'$(Configuration)'=='Debug' and '$(BuildingInsideVisualStudio)'=='true'">
20+
<Exec Command="dotnet publish &quot;$(MSBuildProjectFullPath)&quot; -c $(Configuration) -f $(TargetFramework) -o &quot;$(ProjectDir)bin\$(Configuration)\$(TargetFramework)\publish&quot;" />
21+
</Target>
2122
</Project>

0 commit comments

Comments
 (0)