public object GetDynamicParameters()
        {
            RuntimeDefinedParameterDictionary dynamicParams = null;

            if (taskTypeSet)
            {
                switch (taskType)
                {
                case TaskTypeEnum.ConnectToSourceSqlServer:
                    taskCmdlet = new ConnectToSourceSqlServerTaskCmdlet(this.MyInvocation);
                    break;

                case TaskTypeEnum.MigrateSqlServerSqlDb:
                    taskCmdlet = new MigrateSqlServerSqlDbTaskCmdlet(this.MyInvocation);
                    break;

                case TaskTypeEnum.ConnectToTargetSqlDb:
                    taskCmdlet = new ConnectToTargetSqlDbTaskCmdlet(this.MyInvocation);
                    break;

                case TaskTypeEnum.GetUserTablesSql:
                    taskCmdlet = new GetUserTableSqlCmdlet(this.MyInvocation);
                    break;

                default:
                    throw new PSArgumentException();
                }

                dynamicParams = taskCmdlet.RuntimeDefinedParams;
            }

            return(dynamicParams);
        }
Exemplo n.º 2
0
        public override void ExecuteCmdlet()
        {
            var userName = Credential.UserName;
            var password = TaskCmdlet.Decrypt(Credential.Password);

            var fileShare = new FileShare
            {
                Path     = Path,
                UserName = userName,
                Password = password
            };

            WriteObject(fileShare, false);
        }