Skip to content

Commit 5c64675

Browse files
committed
Fixes in use of Core SDK
1 parent 24fdde8 commit 5c64675

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Commands/Features/DisableFeature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ protected override void ExecuteCmdlet()
2222
var pnpContext = Connection.PnPContext;
2323
if (Scope == FeatureScope.Web)
2424
{
25-
pnpContext.Web.EnsureProperties(w => w.Features);
25+
pnpContext.Web.LoadAsync(w => w.Features).GetAwaiter().GetResult();
2626
pnpContext.Web.Features.Disable(Identity);
2727
}
2828
else
2929
{
30-
pnpContext.Site.EnsureProperties(s => s.Features);
30+
pnpContext.Site.LoadAsync(s => s.Features).GetAwaiter().GetResult();
3131
pnpContext.Site.Features.Disable(Identity);
3232
}
3333
}

src/Commands/Features/EnableFeature.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ protected override void ExecuteCmdlet()
2222
var pnpContext = Connection.PnPContext;
2323
if (Scope == FeatureScope.Web)
2424
{
25-
pnpContext.Web.EnsureProperties(w => w.Features);
26-
pnpContext.Web.Features.Enable(Identity);
25+
pnpContext.Web.LoadAsync(w => w.Features).GetAwaiter().GetResult();
26+
// pnpContext.Web.EnsureProperties(w => w.Features);
27+
pnpContext.Web.Features.EnableAsync(Identity).GetAwaiter().GetResult();
2728
}
2829
else
2930
{
30-
pnpContext.Site.EnsureProperties(s => s.Features);
31-
pnpContext.Site.Features.Enable(Identity);
31+
pnpContext.Site.LoadAsync(s => s.Features).GetAwaiter().GetResult();
32+
// pnpContext.Site.EnsureProperties(s => s.Features);
33+
pnpContext.Site.Features.EnableAsync(Identity).GetAwaiter().GetResult();
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)