Skip to content

Commit 7f93bf9

Browse files
apply apt state for PS7 (#1051)
1 parent 9d07cde commit 7f93bf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class PowerShellContextService : IDisposable, IHostSupportsInteractiveSes
3939
static PowerShellContextService()
4040
{
4141
// PowerShell ApartmentState APIs aren't available in PSStandard, so we need to use reflection
42-
if (!VersionUtils.IsNetCore)
42+
if (!VersionUtils.IsNetCore || VersionUtils.IsPS7)
4343
{
4444
MethodInfo setterInfo = typeof(Runspace).GetProperty("ApartmentState").GetSetMethod();
4545
Delegate setter = Delegate.CreateDelegate(typeof(Action<Runspace, ApartmentState>), firstArgument: null, method: setterInfo);

0 commit comments

Comments
 (0)