You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be completely wrong here, but is anything done with the value passed through Settings parameter?
Maybe something like this could be added on line 29. It's not tested, and the formatting is done using spaces, not tab (pls don't kill), but maybe you find it useful.
protected override void ExecuteCmdlet()
{
try
{
var settings = PnP.Framework.Graph.SiteClassificationsUtility.GetSiteClassificationsSettings(AccessToken);
if (Settings.HasValue)
{
settings = Settings;
}
if (!Settings.HasValue)
{
settings = SetSiteClassification(settings);
}
}
if (settings.Classifications.Contains(settings.DefaultClassification))
{
PnP.Framework.Graph.SiteClassificationsUtility.UpdateSiteClassificationsSettings(AccessToken, settings);
}
else
{
WriteError(new ErrorRecord(new InvalidOperationException("You are trying to set the default classification to a value that is not available in the list of possible values."), "SITECLASSIFICATION_DEFAULTVALUE_INVALID", ErrorCategory.InvalidArgument, null));
}
}
private SiteClassificationsSettings SetSiteClassification( SiteClassificationsSettings settings)
{
if (ParameterSpecified(nameof(Classifications)))
{
if (settings.Classifications != Classifications)
{
settings.Classifications = Classifications;
}
}
if (ParameterSpecified(nameof(DefaultClassification)))
{
if (settings.Classifications.Contains(DefaultClassification))
{
if (settings.DefaultClassification != DefaultClassification)
{
settings.DefaultClassification = DefaultClassification;
changed = true;
}
}
}
if (ParameterSpecified(nameof(UsageGuidelinesUrl)))
{
if (settings.UsageGuidelinesUrl != UsageGuidelinesUrl)
{
settings.UsageGuidelinesUrl = UsageGuidelinesUrl;
changed = true;
}
}
return settings;
}
The text was updated successfully, but these errors were encountered:
powershell/src/Commands/Site/UpdateSiteClassification.cs
Line 18 in e06c687
I might be completely wrong here, but is anything done with the value passed through Settings parameter?
Maybe something like this could be added on line 29. It's not tested, and the formatting is done using spaces, not tab (pls don't kill), but maybe you find it useful.
The text was updated successfully, but these errors were encountered: