Src/SMLETSVERSION.cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Management.Automation;
using Microsoft.EnterpriseManagement;
namespace SMLets
{
    public class SMLetsVersionInfo
    {
        public string TargetProduct = "_TARGETPRODUCT_";
        public string WorkingCopyRootPath = "_WORKINGCOPYROOTPATH_";
        public string URL = "_URL_";
        public string RepositoryRoot = "_REPOSITORYROOT_";
        public string RepositoryUUID = "_REPOSITORYUUID_";
        public string Revision = "_REVISION_";
        public string LastChangedAuthor = "_LASTCHANGEDAUTHOR_";
        public string LastChangedRev = "_LASTCHANGEDREV_";
        public string LastChangedDate = "_LASTCHANGEDDATE_";
        public bool   IsPrivate = _PRIVATE_;
        public string[] Changes = { "_CHANGES_" };
        public string SMCompiledVersion = "_SMCOREVERSION_";
        public string SMInstalledVersion;
#if ( _SERVICEMANAGER_R2_ )
        public bool SM2012 = true; 
#else
        public bool SM2012 = false; 
#endif
        private SMLetsVersionInfo() { ; }
        public SMLetsVersionInfo(SMCmdletBase cmdlet)
        {
            SMInstalledVersion = cmdlet._mg.Version.ToString();
        }
        public SMLetsVersionInfo(EnterpriseManagementGroup emg)
        {
            SMInstalledVersion = emg.Version.ToString();
        }

    }
    [Cmdlet(VerbsCommon.Get, "SMLetsVersion")]
    public class GetSMLetsVersionCommand : SMCmdletBase
    {
        protected override void ProcessRecord()
        {
            WriteObject(new SMLetsVersionInfo(this));
        }
    }
}