Compile scripts as executables for Windows, Mac and Linux

Hello guys,

When I know that Powershell Core will be supported by Windows, Mac and Linux. I decided to rebuild all my code to use the new Cmlets in my own library’s where possible. As documented on " Packaging on Mac OS X"

I copied the example code to my VSCode on Windows and make sure I did install “Powershell Core v7.2.2” and “.Net Core SDK v3.1”, and I get this error:


VERBOSE: Checking license
VERBOSE: OutputPath is C:\Users\arjen\Development\QSharesMapper\out
VERBOSE: Bundling C:\Users\arjen\Development\QSharesMapper\MacInstallShares.ps1     
VERBOSE: Parsing file C:\Users\arjen\Development\QSharesMapper\MacInstallShares.ps1.
VERBOSE: Packaging C:\Users\arjen\AppData\Local\Temp\MacInstallShares.ps1
VERBOSE: Creating temp directory: C:\Users\arjen\AppData\Local\Temp\cd7f00d52c87429ca4b6d3f3cdd0950c
VERBOSE: Packaging modules...
VERBOSE: Checking dotnet version.
VERBOSE: Checking dotnet SDK version.
VERBOSE: 6.0.202

VERBOSE: .NET SDK Version: 6.0.202

VERBOSE: Creating package project.
VERBOSE: Using .NET Framework version: netcoreapp31
VERBOSE:   Determining projects to restore...
  Restored C:\Users\arjen\AppData\Local\Temp\cd7f00d52c87429ca4b6d3f3cdd0950c\MacInstallShares.csproj (in 
365 ms).

VERBOSE:   Determining projects to restore...
  Restored C:\Users\arjen\AppData\Local\Temp\cd7f00d52c87429ca4b6d3f3cdd0950c\MacInstallShares.csproj (in 
365 ms).

VERBOSE: Packaging C:\Users\arjen\AppData\Local\Temp\MacInstallShares.ps1 -> C:\Users\arjen\Development\QSharesMapper\out\MacInstallShares.exe
VERBOSE: Microsoft (R) Build Engine version 17.1.1+a02f73656 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\arjen\AppData\Local\Temp\cd7f00d52c87429ca4b6d3f3cdd0950c\MacInstallShares.csproj (in 
553 ms).
C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App available for the specified RuntimeIdentifier 'osx-x64'. [C:\Users\arjen\AppData\Local\Temp\cd7f00d52c87429ca4b6d3f3cdd0950c\MacInstallShares.csproj]

I have 2 questions about this

  1. Can I compile Mac and Linux exe’s from my Windows VScode, and install it on my Test Macbook or do I need to compile it on VScode on my Macbook?
  2. Can you please explain me how to read this error code, so I can help myself (and maybe others themselves) next time?

I have one additional question
Where did the TUI designer go? Because on 21-04-2022 it was still there: TUI Designer - PowerShell Pro Tools (archive.org)

Kind regards,
Arjen [ARKO]