3

I'm trying to package a Sitecore solution and followed the instructions mentioned in the following URLs.

https://doc.sitecore.net/cloud/working_with_sitecore_azure/configuring_sitecore_azure/getting_started_with_sitecore_azure_toolkit?roles=developer

https://doc.sitecore.net/cloud/working_with_sitecore_azure/configuring_sitecore_azure/package_a_sitecore_solution_for_the_azure_app_service?roles=developer

I have PowerShell (5.0). I have also updated Azure PowerShell Module 3.1.0

When I run the command Start-SitecoreAzurePackaging with all the options specified in the Sitecore documentation, I get the following error.

The term 'New-SCWebDeployPackage' 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.

Am I missing something?

2
  • Have you done Import-Module Sitecore.Cloud.Cmdlets? Commented Dec 13, 2016 at 4:43
  • Yes.. Did that too! "Import-Module Sitecore.Cloud.Cmdlets" ran successfully..
    – Prawin
    Commented Dec 13, 2016 at 5:35

3 Answers 3

10

'New-SCWebDeployPackage' cmdlet will be available after importing assembly Sitecore.Cloud.Cmdlets.dll

By default, loading an assembly from a network path in PowerShell console is disabled, It can be enabled by creating two PowerShell configuration files:

  • C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.config

  • C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe.config

<?xml version="1.0" encoding="utf-8" ?>
  <configuration>
    <runtime>
      <loadFromRemoteSources enabled="true"/>
    </runtime>
  </configuration>

Open new PowerShell console window and import module:

Import-Module "$PSScriptRoot\Sitecore.Cloud.Cmdlets.dll"
3

This helped me when i was getting this issue...

If you downloaded the Sitecore Azure Toolkit as a .ZIP and unzip it, the individual files will be marked as "blocked" files. if they are all blocked your Powershell script wont work.

Before unzipping, right click the zip file, go to security and select the Unblock button on the .ZIP file, then extract.

once i did this it worked fine

2

I faced the same problem. Probably it has to do with your scriptroot: in the psm1 that you imported, there is a line that loads the assembly with some more cmdlets, one them being the New-SCWebDeployPackage:

Import-Module "$PSScriptRoot\Sitecore.Cloud.Cmdlets.dll"

you could try to manually import that module.

1
  • We even tried that but with no luck. Were you able to deploy the solution successfully?
    – Prawin
    Commented Dec 13, 2016 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.