0

I was creating custom functions using Sitecore Powershell script. I accidentally gave the custom function a name similar to the Sitecore function (say Get-Rendering). The default function script block was now overridden with my custom function. Now when I call the default Sitecore function, my custom function code is getting executed.

Please help me with details how to restore the script block for the Default Get-Rendering function.

1

1 Answer 1

1

This issue is less about SPE and more how PowerShell is designed. Creating proxy functions can be helpful when the developer wants to insert additional steps such as logging. The easiest thing to do in your case is to kill the session used in the ISE; a recycle of the app pool will do this for the default ISE session.

There may be ways to restore the function without doing this but not something often encountered so not worth trying to fix it beyond the steps I described.

Your Answer

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

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