Compiling PowerShell 7 Scripts into an Executable in VS Code

Поделиться
HTML-код
  • Опубликовано: 11 июл 2024
  • In this video, I show you how to use PowerShell Pro Tools to compile a PowerShell 7 script into an executable in VS Code. The packaging process embeds the script, the .NET Core runtime as well as the PowerShell 7 runtime. The resulting executables are portable and can run on machines that do not have PS7 installed.
    At the end of the video, I show how to package a script for execution on Linux. Currently, this feature is experimental.
    To learn more about PowerShell Pro Tools, visit our website: ironmansoftware.com/powershel...
  • НаукаНаука

Комментарии • 9

  • @TheWurstpeter
    @TheWurstpeter 4 года назад

    Nice, is there a way to not include the .net and pwsh stuff in the exe ? i just want a smal sized "app" without the overhead

    • @AdamDriscoll
      @AdamDriscoll  4 года назад +1

      It's likely possible but PoshTools doesn't work that way at the moment. Something I could certainly investigate.

  • @portentouslad5051
    @portentouslad5051 3 года назад

    Will this incorporate imported PS modules? Like RSAT modules? I'm looking for a way to run scripts without the need to install the module locally.

    • @DrewPador
      @DrewPador 3 года назад +1

      Store your modules in a network drive, then at the beginning of your script you can use the Import-Module command and point to the folder containing the necessary modules. Ideally, all your clients should be looking to a central location for all the modules running in your environment which become handy when you start creating your own modules.

  • @dimitri.dittrich
    @dimitri.dittrich 3 года назад

    Here when I try to generate the exe it gives the error: "PowerShell does not support debugging this file type: 'c:\test.psd1'

  • @jayd9203
    @jayd9203 2 года назад +1

    So I need a license to create the exe? I installed the tools and tried to package but I get a message that says I need a license. That would have been nice to know before I waisted my time.

    • @AdamDriscoll
      @AdamDriscoll  2 года назад

      We provide 14-day trials as to not completely waste your time. ironmansoftware.com/trial/powershell-pro-tools

  • @PhrostB
    @PhrostB Год назад

    doesn't seem to work for me.. just says "downloading powershell pro tools host (2023.2.0) at the bottom and never actually compiles the exe. says the term "merge-script" is not recognized as the name of a cmdlet.. etc"

  • @krzydoug80
    @krzydoug80 4 года назад +4

    Do you sleep?