Get-BpaModel and Set-ExecutionPolicy RRS feed

  • Question

  • In PowerShell what should all of my 'ExecutionPolicy' scopes be in order for 'Get-BpaModel' to run properly?

    On a Windows 2012 R2 server with the File Server role installed I'm attempting to run 'Get-BpaModel' in PowerShell and receiving the following error:

    Get-BpaModel : There has been an error while trying to set the process wide execution policy. (Inner Exception:
    Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a
    more specific scope.  Due to the override, your shell will retain its current effective execution policy of
    Unrestricted. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information please see
    "Get-Help Set-ExecutionPolicy".)
    At line:1 char:1
    + Get-BpaModel
    + ~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-BpaModel], CommandLetException
        + FullyQualifiedErrorId : SetExecutionPolicyError,Microsoft.BestPractices.Cmdlets.GetModelCommand

    Doing a 'Get-ExecutionPolicy -List' shows the following:

              Scope                                             ExecutionPolicy
              -----                                             ---------------
      MachinePolicy                                                Unrestricted
         UserPolicy                                                   Undefined
            Process                                                RemoteSigned
        CurrentUser                                                   Undefined
       LocalMachine                                                RemoteSigned

    I can invoke this error too by going via Server Manager > Local Server > Best Practices Analyzer.

    • Edited by vcekid Monday, November 10, 2014 9:47 PM relate it to the server manager
    Monday, November 10, 2014 9:45 PM