internal static void ValidateCmdletParameters(string cmdlet)
        {
            CmdletValidator   cmdletValidator   = new CmdletValidator(DlpPolicyTemplateMetaData.AllowedCommands, DlpPolicyTemplateMetaData.RequiredParams, null);
            ScriptParseResult scriptParseResult = cmdletValidator.ParseCmdletScript(cmdlet);

            if (!scriptParseResult.IsSuccessful)
            {
                throw new DlpPolicyParsingException(Strings.DlpPolicyNotSupportedCmdlet(cmdlet));
            }
        }
Ejemplo n.º 2
0
        private static string AddOrganizationParameter(string command, string organization)
        {
            string text = string.Format("-{0}", "Organization");

            if (CmdletValidator.IsParameterPresent(command, text))
            {
                throw new InvalidOperationException("OrganizationParameter specified");
            }
            return(string.Format("{0} {1} \"{2}\"", command, text, organization));
        }