What's the deal with Deno? We talk with a major contributor to find out. Listen now.
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\...


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

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.


6

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


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

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


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

# 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() ...


4

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


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

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


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


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


3

Open PowerShell as administrator and set Execution policy by running the below command and accept it by saying “A” (Yes to ALL). Set-ExecutionPolicy RemoteSigned Then run the below your command: Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2


3

That's an interesting error message, as it seems to be mixing up two things: The variable it refers to is SC_SQL_SERVER_USER - which is used by the MSI installation to store the database username used for connecting while installing the Sitecore databases. The rest of the error "Could not access network location", and the 1606 error number suggests a ...


3

This is a bug in SIF/ Set-content. This is now fixed in version 2.1, run Update-Module -Name SitecoreInstallFramework . It's caused by another application, usually Chrome or VS code taking control of the hosts file while it's being written to. For now, make sure that you don't have Chrome or similar running when you do the uninstall. Then it should be OK....


3

If you want to use _latestVersion with Find-Item command then you will need to use -Criteria instead of -Where because -Where uses SearchResultItem class to map the properties whereas -Criteria work directly against Solr fields. Example - $clubTemplateId = New-Object Sitecore.Data.ID::new("{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}") $wogTemplateId = New-...


3

If you are using SPE 6.0 this might work for you. Introduced with this issue. class ExtendedSearchResultItem : SearchResultItem { [Sitecore.ContentSearch.IndexField("_latestversion")] [bool]$IsLatestVersion } $props = @{ Index = "sitecore_master_index" Where = "IsLatestVersion == @0" WhereValues = $true QueryType = [...


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