none
Using Powershell 5 and Core for an installation script RRS feed

  • Question

  • I've used PS 5.X for writing installation scripts before but with Powershell Core in Preview I want to plan ahead. I've got to write an install script for a number of managed and unmanaged components that will run on Windows. But sometime later, I will want to install those components (or their platform-equivalents) on various Linux versions. If I start with just Powershell 5 right now for Windows, will those scripts be somewhat portable to Powershell Core (assuming of course I'll have to change paths) for Linux?

    The other question is, if I were to write an installer right now in Powershell Core, for my customers running Windows, would they have to do a separate download of the Powershell Core runtime bits prior to running my script?

    Thanks,

     Bob

    • Moved by Bill_Stewart Tuesday, July 31, 2018 3:06 PM Unanswerable drive-by question
    Tuesday, June 26, 2018 11:52 PM

All replies

  • There is no simple answer to these questions.  You will have to learn enough about both and what it is you are installing to make this judgment.

    No matter how you run your installer, Windows executables will never run on Linux so the whole concept is faulty at its foundations.

    PowerShell is targeted at management functions and building tools for developers and applications.  It is not designed to be an installer and will cause grief if you try to use it like that short of simple copy scripts. PowerShell cannot install Windows apps on Linux and it cannot install Linux apps on Windows.  PowerShell Core will not make this possible.  That is not its intended purpose.


    \_(ツ)_/

    Wednesday, June 27, 2018 12:05 AM