/Source/FIMPSSnapIn.cs
C# | 62 lines | 52 code | 8 blank | 2 comment | 1 complexity | e4220cb8944ed471b11e8c22621d621d MD5 | raw file
- using System;
- using System.ComponentModel;
- using System.Management.Automation;
- using System.Collections;
- using System.IO;
-
- namespace Quest.FIMPowerShellSnapin
- {
- [RunInstaller(true)]
- public class FIMPowerShellSnapin : PSSnapIn
- {
- public override string Name
- {
- get { return "Quest.FIMPowerShellSnapin"; }
- }
-
- public override string Vendor
- {
- get { return "Quest Software"; }
- }
-
- public override string Description
- {
- get { return "This snap-in contains cmdlets for Microsoft Forefront Identity Manager (FIM)."; }
- }
-
- public override string[] Formats
- {
- get
- {
- return GetFileNames("Format");
- }
- }
-
- public override string[] Types
- {
- get
- {
- return GetFileNames("Types");
- }
- }
-
- private string[] GetFileNames(string suffix)
- {
- // we assume the types file is in the same folder as the snap-in dll
- string snapinName = GetType().Module.FullyQualifiedName;
-
- string resultFilename =
- Path.ChangeExtension(snapinName, suffix + ".ps1xml");
-
- // w/o this check if the file is missing we'll get an error when opening the PS console
- if (File.Exists(resultFilename))
- {
- return new string[] { resultFilename };
- }
- else
- {
- return null;
- }
- }
- }
- }