Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup-Host Exception #259

Closed
williammoore175 opened this issue Jan 29, 2022 · 2 comments
Closed

Setup-Host Exception #259

williammoore175 opened this issue Jan 29, 2022 · 2 comments

Comments

@williammoore175
Copy link

Good evening. I have started your Powershell - Your First Day course and have tried to run the setup instructions (updated). But I ran into the following exception:

PS C:> Setup-Host -DestinationPath C:\Autolab
Setup-Host : The 'Setup-Host' command was found in the module 'PSAutoLab', but the module could not be loaded. For
more information, run 'Import-Module PSAutoLab'.
At line:1 char:1

  • Setup-Host -DestinationPath C:\Autolab
  •   + CategoryInfo          : ObjectNotFound: (Setup-Host:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    
    

PS C:> Import-Module PSAutoLab
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\Lability\0.20.0\Lability.psm1 cannot be loaded because
running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • Import-Module PSAutoLab
  •   + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

It appears running scripts has been disabled. Do you have advisement on how to get it re-enabled. Thank you.

@jdhitsolutions
Copy link
Collaborator

Looks like you need to run Set-ExecutionPolicy RemoteSigned -force in an elevated PowerShell session.

@jdhitsolutions
Copy link
Collaborator

Closing as inactive and presumably resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants