I am calling the powershell script programmatically using Sitecore Command.. ScriptSession.ExecuteScriptPart() ... Inside the script I have written following script:
$settingItemId = "/sitecore/content/XXXX/Settings/Setting"
$settingItem = Get-Item $settingItemId
It is throwing error:
Get-Item : Cannot find path 'C:\sitecore\content\XXXX\Settings\Setting' because it does not exist.
At line:122 char:16
+ $settingItem = Get-Item $settingItemId
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\sitecore\con...zation Settings:String) [Get-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand
Cannot index into a null array.
adding C:\ drive..
Can someone help me here?
Thanks.
Get-Item -Path "master:\content\xxx"
– Marek Musielak Sep 3 '20 at 6:59Get-Item -ID GUID -Database "master"
? – Marek Musielak Sep 3 '20 at 8:05