Interoperability of PowerShell

Welcome Forums General PowerShell Q&A Interoperability of PowerShell

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 8 months ago.

  • Author
  • #5871

    Topics: 1562
    Replies: 0
    Points: 0
    Rank: Member

    by gretty at 2013-04-30 20:11:08


    I am distributing an installer and it will open and run a PowerShell script. The installer will be used by people who have Windows XP and up.

    Am I guaranteed that this script will run/execute on all these versions of Windows? I'm looking for the similar Cross-Windows-Platform interoperability that Batch files provide.

    I've heard of the error: "File cannot be loaded because the execution of scripts is disabled on this system" what can I do in this scenario? If a user has disabled scripts does that mean I will need to use a different language(maybe just Batch)?

    by DonJ at 2013-05-04 08:57:50

    First, no, you are not guaranteed. XP doesn't come with PowerShell, and Vista ships with v1. You would need to ensure that PowerShell (of whatever version you want) is installed.

    Second, the error your refer to is because the default execution policy in PowerShell prevents scripts from running. Read the help for the Set-ExecutionPolicy command. Users do not get to enable/disable this; it is an administrator function often managed through a Group Policy object.

The topic ‘Interoperability of PowerShell’ is closed to new replies.