Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
macos.md42 linesDownload Raw Back to building
1# Build PowerShell on macOS2 3This guide supplements the [Linux instructions](./linux.md), as4building on macOS is almost identical.5 6.NET Core 2.x (and by transitivity, us) only supports macOS 10.13+.7 8## Environment9 10You will want [Homebrew](https://brew.sh/) or [MacPorts](https://www.macports.org/), the missing package manager for macOS.11Once installed, follow the same instructions to download and12install a self-hosted copy of PowerShell on your macOS machine.13From `pwsh.exe`, run `Import-Module ./build.psm1` and use `Start-PSBootstrap` to install the dependencies.14 15The `Start-PSBootstrap` function does the following:16 17- Uses `brew` or `port` to install OpenSSL, and GNU WGet18- Uninstalls any prior versions of .NET CLI19- Downloads and installs .NET Core SDK to `~/.dotnet`20 21If you want to use `dotnet` outside of `Start-PSBuild`,22add `~/.dotnet` to your `PATH` environment variable.23 24### error: Too many open files25 26Due to a [bug][809] in NuGet, the `dotnet restore` command will fail without the limit increased.27Run `ulimit -n 2048` to fix this in your session;28add it to your shell's profile to fix it permanently.29 30We cannot do this for you in the build module due to #[847][].31 32[809]: https://github.com/dotnet/cli/issues/80933[847]: https://github.com/PowerShell/PowerShell/issues/84734 35## Build using our module36 37Start a PowerShell session by running `pwsh`, and then use `Start-PSBuild -UseNuGetOrg` from the module.38 39After building, PowerShell will be at `./src/powershell-unix/bin/Debug/net6.0/osx-x64/publish/pwsh`.40 41> The PowerShell project by default references packages from the private Azure Artifacts feed, which requires authentication. The `-UseNuGetOrg` flag reconfigures the build to use the public NuGet.org feed instead.42