Example #1
0
 /// <summary>
 ///
 /// </summary>
 protected override void BeginProcessing()
 {
     _commandWrapper = new CommandWrapper();
     if (String.Equals(ParameterSetName, "File", StringComparison.OrdinalIgnoreCase))
     {
         _commandWrapper.Initialize(Context, "out-file", typeof(OutFileCommand));
         _commandWrapper.AddNamedParameter("filepath", _fileName);
         _commandWrapper.AddNamedParameter("append", _append);
     }
     else if (String.Equals(ParameterSetName, "LiteralFile", StringComparison.OrdinalIgnoreCase))
     {
         _commandWrapper.Initialize(Context, "out-file", typeof(OutFileCommand));
         _commandWrapper.AddNamedParameter("LiteralPath", _fileName);
         _commandWrapper.AddNamedParameter("append", _append);
     }
     else
     {
         // variable parameter set
         _commandWrapper.Initialize(Context, "set-variable", typeof(SetVariableCommand));
         _commandWrapper.AddNamedParameter("name", _variable);
         // Can't use set-var's passthru because it writes the var object to the pipeline, we want just
         // the values to be written
     }
 }