Esempio n. 1
0
        public static PSNetAppFilesVolumeExportPolicy ConvertExportPolicyToPs(VolumePropertiesExportPolicy ExportPolicy)
        {
            PSNetAppFilesVolumeExportPolicy PsExportPolicy = new PSNetAppFilesVolumeExportPolicy();
            var rules = new List <PSNetAppFilesExportPolicyRule>();

            foreach (var Rule in ExportPolicy.Rules)
            {
                PSNetAppFilesExportPolicyRule PsExportPolicyRule = new PSNetAppFilesExportPolicyRule
                {
                    RuleIndex           = Rule.RuleIndex,
                    UnixReadOnly        = Rule.UnixReadOnly,
                    UnixReadWrite       = Rule.UnixReadWrite,
                    Cifs                = Rule.Cifs,
                    Nfsv3               = Rule.Nfsv3,
                    Nfsv41              = Rule.Nfsv41,
                    AllowedClients      = Rule.AllowedClients,
                    HasRootAccess       = Rule.HasRootAccess,
                    Kerberos5iReadOnly  = Rule.Kerberos5iReadOnly,
                    Kerberos5iReadWrite = Rule.Kerberos5iReadWrite,
                    Kerberos5pReadOnly  = Rule.Kerberos5pReadOnly,
                    Kerberos5pReadWrite = Rule.Kerberos5pReadWrite,
                    Kerberos5ReadOnly   = Rule.Kerberos5ReadOnly,
                    Kerberos5ReadWrite  = Rule.Kerberos5ReadWrite
                };
                rules.Add(PsExportPolicyRule);
            }
            PsExportPolicy.Rules = rules.ToArray();
            return(PsExportPolicy);
        }
        public override void ExecuteCmdlet()
        {
            PSNetAppFilesExportPolicyRule exportPolicyRuleItem = new PSNetAppFilesExportPolicyRule()
            {
                RuleIndex           = RuleIndex,
                UnixReadOnly        = UnixReadOnly,
                UnixReadWrite       = UnixReadWrite,
                Kerberos5ReadOnly   = Kerberos5ReadOnly,
                Kerberos5ReadWrite  = Kerberos5ReadWrite,
                Kerberos5iReadOnly  = Kerberos5ReadOnly,
                Kerberos5iReadWrite = Kerberos5ReadWrite,
                Kerberos5pReadOnly  = Kerberos5ReadOnly,
                Kerberos5pReadWrite = Kerberos5ReadWrite,
                Nfsv3          = Nfsv3,
                Nfsv41         = Nfsv41,
                Cifs           = Cifs,
                HasRootAccess  = HasRootAccess,
                AllowedClients = AllowedClient,
                ChownMode      = ChownMode
            };

            WriteObject(exportPolicyRuleItem);
        }