Skip to content

PowerShell - http request context issue #1113

@chris-madamba

Description

@chris-madamba

Expected Behavior

Executing a script using "Execute in http request context" will get selected language of the item.

Actual Behavior

"Execute in http request context" will currently only getting the default language of "en-US" using PowerShell ISE or executing script in the Content Tree using Context Menu

Steps to Reproduce the Problem

Sitecore PowerShell Extensions 5.0.0.42513
Sitecore 8.2
Windows PowerShell 5.1

Hello,

I currently have an Expand-Tokens script that runs as expected in the PowerShell ISE when using the "Execute in a background job" but when I attempt to execute the same script in the Sitecore Content Tree using the context menu the script always picks up the default language of en-US instead of the actual selected language of that Item (i.e. en-CA or fr-CA)

In the PowerShell ISE if I have a selected language: en-CA (English - Canada) and a Sitecore Content Item selected. When running the script as "Execute in a background job" the correct language item gets update using the Expand-Tokens function.

If I attempt to execute the same script using the "Execute in http request context" only the default language (en - United States) gets updated regardless if the correct language is selected (en-CA). This is also the case when attempting to execute the script in the Sitecore Content Tree using the PowerShell Extensions from the context menu.

I've attached screen shots for reference.

Is there a way to make sure that the PSE picks up the selected language for the selected Sitecore item?

Thanks!

PS-Extension-http-request

PS_ISE_-_Background

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions