20

You might want to consider psake. It is a task based build system written in Powershell. A good starting point would be this piece of code: # Let's define layers here $layers = @( "Foundation", "Feature", "Project" ) # These folders we want to copy to our target $foldersToCopy = @( "Views", "bin", "App_Config" ) # This is the default task which will run ...


14

It's a small thing which I'm hoping to have fixed soon so that things are a little clearer, sorry this isn't as straight-forward as it should be! Calling Register-SitecoreInstallExtension outside of a running install does nothing as there is no context for it to operate in. The function actually sets information in a dictionary when the install itself ...


11

Just observed that in Solr 7.1.0 the folder structure is quite different than 6.6.2. Hence the power shell script is unable to find the required folders. In my case the script is looking for basic_configs folder in \solr-7.1.0\server\solr\configsets, but the folder in no more exists here in Solr 7.1.0, seeme they moved the related files to to \solr-7.1.0\...


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\...


8

The solution for this issue was to add SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] before first RUN Invoke-Expression Update: Seems like 20H2 defaults to CMD instead of SHELL.


7

I found the Answer ,download the file below only if you have "SQL SERVER 2017" https://gitlab.com/viet.hoang/workshop/raw/master/Scripts%20for%20Sitecore%20Commerce%20901/DeployCommerceDatabase.psm1 Overwrite this file on the installation SIF.Sitecore.Commerce.1.0.1748\Modules\DeployCommerceDatabase\DeployCommerceDatabase.psm1 Run the script to Install ...


7

Should be fairly simple. You can use the PowerShell Import-CSV command to load a CSV file in: $importRows = Import-CSV "C:\path-to-your-file\import-data.csv" Then you can enumerate through that and create the items using the New-Item command. This example assumes a field name in the CSV of ItemName. For speed you probably want to wrap this in a ...


7

Marek's answer is correct and addresses the error, but it's worth bearing in mind that in the situation posted, you have a simpler option available to you: $path = "/sitecore/content/home" $items = Get-ChildItem $path -Recurse -WithParent The -WithParent parameter will automatically include the root item for you.


7

This has happened because "Docker Desktop" was not running on my machine. I started "Docker Desktop" and execute the script again. I was able to install a sample project for Sitecore Headless Development.


6

It's never recommended to perform any updates in web database directly. If you do this without running exactly the same updates in master database If publish anything in master database later, you'll overwrite your web database changes. If your application depends on indexes like sitecore_web_index, most probably it's using onPublishEndAsync strategy which ...


5

You can install packages via DSC - but I don't think automating the UI is the right way to go about it. When I worked through this issue I dealt with it by creating an endpoint that DSC can push the packages to without bothering with the UI: Dependencies for getting the install done First up, you'll need an endpoint to trigger the install. My DSC approach ...


5

To answer your questions: There is no requirement that the Sitecore environments be on different servers, you could have any amount of Sitecore instances available for content consumption. Changing the target frame shouldn't cause the issues that you are seeing. The issues are definately centered around MicroChap. Here are the basics with how Content ...


5

# get media item $media = Get-Item -Path "/sitecore/media library/Default Website/FL_insurance_sample" # get stream and save content to variable $content [System.IO.Stream]$body = $media.Fields["Blob"].GetBlobStream() try { $contents = New-Object byte[] $body.Length $body.Read($contents, 0, $body.Length) | Out-Null } finally { $body.Close() ...


5

You have 2 ways - if you can connect up Sitecore Rocks, that has an option to multi-select items and move them around in Visual Studio and rename etc... The second option would be to use Sitecore PowerShell Extensions (SPE) to script that out. This example will give you a good starting place: $rootOfitemsToMove = Get-Item “/sitecore/content/Location A/...


5

The output of Find-Item command is a SearchResultItem object. You need to call GetItem() on it first and then you can run commands which will return presentation details. I'm not sure exactly what you want to return but sample code goes as: $criteria = @( ... ) $props = @{ Index = "sitecore_master_index" Criteria = $criteria } $searchResultItems ...


5

You can use the script below. Just set the root directory which holds your forms to $formsRoot variable. The script: gets all the forms from the root gets ids of all the save actions in the system creates a regex based on the ids of the actions calls the regex on the value of the Save Actions field $formsRoot = "/sitecore/content/MYSITE/WffmForms" $forms =...


5

I managed to get it working using this approach: $item = Get-Item -Path "master:{F4819743-C9D5-48A4-911B-017F8BA1415C}" # Change the name 'ShowRule' to whatever your rule field is called $renderer = New-Object Sitecore.Shell.Applications.Rules.RulesRenderer ($item.ShowRule) $sw = New-Object System.IO.StringWriter $renderer.Render($sw) $records = ...


4

The certificate which is used for XConnect must contain a "special" private key. Not any private key will do it. If you take a closer look at the SIF files, you'll notice, that the Self-Signed Certificate is created in a special way (I'll post only the important parts here): $xconnectCert = New-SelfSignedCertificate -Type SSLServerAuthentication -...


4

There is an option of performing the minimal installation, which does not make use of Sitecore items. You can find more details on the security page in the book. The Sitecore Marketplace has the minimal installation package, which is a standard zip file of configs and dlls that are dropped into your Sitecore bin/App_Config directories.


4

As far as editing an item, your script looks to be doing what it needs to, but I'm guessing the actual date value is not something Sitecore recognized for a Date type field. Depending on the date format your CSV contains, you will likely need to utilize the Sitecore.DateUtil class to parse it into something that field can accept: $currentItem.Editing....


4

As Micheal West said, using fast query is not a recommended option. Answer for your question is $query = "fast:/sitecore/content/Folder//*[@@TemplateID='{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}']" use //* to get the descendants.


4

We had the same issue and solution was to enable Spe.IdentityServer.config at \inetpub\wwwroot\website\App_Config\Include\Spe. OOTB this file comes with Sitecore Powershell module as disabled. Just need to remove .disabled from the config name.


4

To rebuild indexes from sitecore powershell you can use below script which will re-index all indexes one by one using namespace Sitecore.ContentSearch $indexes = [ContentSearchManager]::Indexes foreach($index in $indexes){ Write-Host "Re-indexing started " $index.Name $index.Rebuild([IndexingOptions]::ForcedIndexing); Write-Host "Re-indexing ...


4

Your code works ok when there are multiple items returned from Get-ChildItem command. If only 1 item is returned, SPE returns single item object instead of an array. You can work around the issue by wrapping both $root and $items variables with @(...) like: $path = "/sitecore/content/home" $root = @(Get-Item $path) $items = @(Get-ChildItem $path -Recurse) ...


4

You can manage all default scripts for sure. Especially scripts, that you ask for, are located under the following item: /sitecore/system/Modules/PowerShell/Script Library/SPE/Reporting/Content Reports/Reports/Content Audit Choose script that you want to change, click on Elevate session button, enter a user password and you will see a source of script in ...


3

It seems that the local account user you have used for the application pool do not have sufficient access or the credentials are incorrectly entered for the user. Please refer this blog post for troubleshooting. https://himadritechblog.wordpress.com/2018/03/10/yet-another-sitecore-commerce-9-installation-blog-post/ It mentions that the service unavailable ...


3

To update the workflow for the current item’s descendants, you can use the below script $contentsToUpdate = Get-Item master: -Query "sitecore/content/ParentItem//*" -Language "en-GB" foreach($content in $contentsToUpdate) { $content.Editing.BeginEdit() $content.Fields["__Default workflow"].Value = "Item ID of Default Workflow" $content....


3

Your database is complaining that the password you specified for the messaging user (SqlMessagingPassword parameter) is too "simple". SQL will enforce you to use stronger passwords for your users. Just set the password in that parameter in the json file to something better. Check the other passwords in the json file as well before retrying (and do a ...


3

In answer to your other question, you can run commands from a powershell console using SPE's remoting feature: https://sitecorepowershell.gitbooks.io/sitecore-powershell-extensions/remoting.html


3

You can use the below script to add rendering to the items. $containerArray = @("{Sitecore Id goes here}","{Sitecore Id goes here}","{Sitecore Id goes here}") foreach ($element in $containerArray){ $items = Get-ChildItem -ID $element.ID -Language "en" $addedRendering = Get-Item "master:path to your rendering goes here" | New-Rendering -Placeholder ...


Only top voted, non community-wiki answers of a minimum length are eligible