protected override void ExecuteCmdlet() { var hidden = SiteCollection.IsTeamifyPromptHiddenAsync(ClientContext).GetAwaiter().GetResult(); if (!hidden) { SiteCollection.HideTeamifyPromptAsync(ClientContext).GetAwaiter().GetResult(); } else { WriteWarning("Teamify prompt was already hidden"); } }
/// <summary> /// Checks whether the teamify prompt is hidden in O365 Group connected sites /// </summary> /// <param name="clientContext">ClientContext of the site to operate against</param> /// <returns></returns> public static async Task <bool> IsTeamifyPromptHidden(this ClientContext clientContext) { await new SynchronizationContextRemover(); return(await SiteCollection.IsTeamifyPromptHiddenAsync(clientContext)); }