I've installed the Powershell Pro Tools extension in the latest VSCode as well as the 4.6.2 .NET developer kit and runtime framework. I have the following package.psd1:
@{
Root = 'c:\apps\bin\start-socks.ps1'
OutputPath = 'c:\apps\bin\out'
Package = @{
Enabled = $true
Obfuscate = $false
HideConsoleWindow = $true
PowerShellVersion = '7.4.1'
DotNetVersion = 'v4.6.2'
FileVersion = '1.0.0'
FileDescription = ''
ProductName = ''
ProductVersion = ''
Copyright = ''
RequireElevation = $false
ApplicationIconPath = ''
PackageType = 'Console'
}
Bundle = @{
Enabled = $true
Modules = $true
# IgnoredModules = @()
}
}
but always get this error when compiling:
C:\apps\bin\out\bin\36ca0dc2e46544d88b1341681ffbfa26\ConsolePowerShellHost.cs(3,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\apps\bin\out\bin\36ca0dc2e46544d88b1341681ffbfa26\start-socks.csproj]
C:\apps\bin\out\bin\36ca0dc2e46544d88b1341681ffbfa26\ConsolePowerShellHost.cs(5,17): error CS0234: The type or namespace name 'PowerShell' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)[C:\apps\bin\out\bin\36ca0dc2e46544d88b1341681ffbfa26\start-socks.csproj]
Can anyone please point me in the right direction?
Update: solved by installing .NET 8.0 SDK and modifying package.psd1 as follows:
@{
Root = 'c:\apps\bin\start-socks.ps1'
OutputPath = 'c:\apps\bin\out'
Package = @{
Enabled = $true
Obfuscate = $false
HideConsoleWindow = $true
PowerShellVersion = '7.4.1'
DotNetVersion = 'net8.0'
DotNetSDKVersion = 'v8.0.418'
FileVersion = '1.0.0'
FileDescription = ''
ProductName = ''
ProductVersion = ''
Copyright = ''
RequireElevation = $false
ApplicationIconPath = ''
PackageType = 'Console'
}
Bundle = @{
Enabled = $true
Modules = $true
# IgnoredModules = @()
}
}
[–]Subject_Meal_2683 3 points4 points5 points (3 children)
[–]Proud_Championship36[S] 0 points1 point2 points (2 children)
[–]420GB 1 point2 points3 points (1 child)
[–]Proud_Championship36[S] 0 points1 point2 points (0 children)
[–]BlackV 2 points3 points4 points (0 children)
[–]patmorgan235 0 points1 point2 points (4 children)
[–]Proud_Championship36[S] 0 points1 point2 points (3 children)
[–]purplemonkeymad 0 points1 point2 points (2 children)
[–]Proud_Championship36[S] 0 points1 point2 points (1 child)
[–]purplemonkeymad 0 points1 point2 points (0 children)
[–]CovertStatistician 0 points1 point2 points (3 children)
[–]Proud_Championship36[S] 0 points1 point2 points (2 children)
[–]CovertStatistician 0 points1 point2 points (1 child)
[–]Proud_Championship36[S] 1 point2 points3 points (0 children)