/Source/NewFIMSession.cs
C# | 41 lines | 31 code | 3 blank | 7 comment | 0 complexity | de81d906b7f213b05fd7e1534654fc87 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Management.Automation;
-
- namespace Quest.FIMPowerShellSnapin
- {
- /// <summary>
- /// Class that defines the New-FIMSession cmdlet
- /// </summary>
- [Cmdlet(VerbsCommon.New, Constants.Nouns.FIMSession)]
- public class NewFIMSession : PSCmdlet
- {
- [Parameter(ValueFromPipeline = true)]
- [ValidateNotNullOrEmpty]
- public PSCredential Credential
- {
- get;
- set;
- }
-
- [Parameter(Mandatory = true)]
- [ValidateNotNullOrEmpty]
- public string Server
- {
- get;
- set;
- }
-
- /// <summary>
- /// Use the Server and Credential parameters to create a new FIMPSSession, and output that to the Powershell pipeline. Allow the
- /// PS host to handle any exceptions.
- /// </summary>
- protected override void ProcessRecord()
- {
- FIMPSSession session = new FIMPSSession(Server, Credential, Host);
- WriteObject(session);
- }
- }
- }