cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhotoBiker Frequent Visitor
Frequent Visitor

[Staff] Lab1 - Error message when trying to run Setup-Model.ps1

Hi,

 

I got stuck at Lab01 when trying to run the file Setup-Model.ps1. I successfully set up the Virtual Machine, but when trying to run that file (right click -> Run with Power Shell). Please see attached screenshot, and here's the full error message:


Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a Invoke-ASCmd : The term 'Invoke-ASCmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At F:\Labs\Lab01\Assets\Setup-Model.ps1:1 char:1 + Invoke-ASCmd –InputFile "F:\Labs\Setup\Scripts\Lab01-Setup-Reseller_S ... + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Invoke-ASCmdSmiley Frustratedtring) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Invoke-ASCmd : The term 'Invoke-ASCmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At F:\Labs\Lab01\Assets\Setup-Model.ps1:2 char:1 + Invoke-ASCmd –InputFile "F:\Labs\Setup\Scripts\Lab01-Setup-Reseller_S ... + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Invoke-ASCmdSmiley Frustratedtring) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException


Could somebody please help me out?

 

Thank you very much in advance!

 

Error_Setup-Model_ps1.png

 

7 REPLIES 7
Fkarlsson Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

I have the exact same problem, solved it yet?

LuisPalencia Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

You nedd add Managment Tools-Basic.   Check this links: https://stackoverflow.com/questions/42762989/invoke-sqlcmd-unable-to-run

 

PhotoBiker Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

Hi Luis,

 

Thank you very much for your reply, that's great, it'll help me for future reference. 

 

I'm fairly disappointed in EdX staff, I had tried several routes, but never got any answer (except somebody suggestion to add [Staff] at the beginning of the subject line, but that didn't work either.

 

The training itself was great, but when you need help - good luck :/

kt_3912 Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

I ran into the same problem. Installing SqlServer PowerShell module resolved it: https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module

Em Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

Bonjour

 I get this message when I install the module

 

PackageManagement\Install-Package : A command with name 'Add-SqlAvailabilityDatabase' is already available on this
system. This module 'SqlServer' may override the existing commands. If you still want to install this module
'SqlServer', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

Em Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

Hello

Thanks for the help.

I get this message when I install.

 

Em

 

PackageManagement\Install-Package : A command with name 'Add-SqlAvailabilityDatabase' is already available on this
system. This module 'SqlServer' may override the existing commands. If you still want to install this module
'SqlServer', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

kt_3912 Frequent Visitor
Frequent Visitor

Re: [Staff] Lab1 - Error message when trying to run Setup-Model.ps1

As the message says use -AllowClobber parameter when installing. E.g.

Install-Module -Name SqlServer -AllowClobber