Console
Console copied to clipboard
Error while executing ItemExists(string path='//BUG')
Expected Behavior
No exceptions in logs
Actual Behavior
SPE Logs:
112336 08:34:42 INFO Arbitrary script execution in ISE by user: 'sitecore\Admin'
ManagedPoolThread #8 08:34:42 ERROR Error while executing ItemExists(string path='//BUG')
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Spe
at Spe.Core.Provider.PsSitecoreItemProvider.GetItemForPath(String path)
at Spe.Core.Provider.PsSitecoreItemProvider.ItemExists(String path)
Steps to Reproduce the Problem
- open ISE
- run
Test-Path "//BUG" - see SPE logs
These work as expected:
Test-Path -Path "//bug"
Get-Item -Path "master://bug"
Get-ChildItem -Path "//bug"
This threw an error:
Get-Item -Path "//bug"
Confirmed as fixed. Splendid work, guys!
Actually this was a bit more complex and needed some additional work as the fix provided caused the following piping crash (added what-if so that it's non destructive but demonstrates the problem)
Get-Item -Path "master:\content\" | Remove-Item -recurse -force -WhatIf
This e.g. caused scripts like "Purge Empty libraries" to not work.