77using Microsoft . ResourceManagement . WebServices ;
88using System . Collections ;
99using Lithnet . ResourceManagement . Client ;
10+ using System . Globalization ;
1011
1112namespace Lithnet . ResourceManagement . Automation
1213{
@@ -47,15 +48,26 @@ public class GetResource : PSCmdlet //, IDynamicParameters
4748 [ Parameter ( ParameterSetName = "GetResource" , Mandatory = false , Position = 2 ) ]
4849 public string [ ] AttributesToGet { get ; set ; }
4950
51+ [ Parameter ( ParameterSetName = "GetResourceByKey" , Mandatory = false , Position = 5 ) ]
52+ [ Parameter ( ParameterSetName = "GetResourceByKeys" , Mandatory = false , Position = 4 ) ]
53+ [ Parameter ( ParameterSetName = "GetResource" , Mandatory = false , Position = 3 ) ]
54+ public string Locale { get ; set ; }
55+
5056 protected override void ProcessRecord ( )
5157 {
5258 ResourceObject resource ;
59+ CultureInfo locale = null ;
60+
61+ if ( this . Locale != null )
62+ {
63+ locale = new CultureInfo ( this . Locale ) ;
64+ }
5365
5466 UniqueIdentifier uniqueID = this . ID as UniqueIdentifier ;
5567
5668 if ( uniqueID != null )
5769 {
58- resource = RmcWrapper . Client . GetResource ( uniqueID , this . AttributesToGet ) ;
70+ resource = RmcWrapper . Client . GetResource ( uniqueID , this . AttributesToGet , locale ) ;
5971
6072 if ( resource == null )
6173 {
@@ -70,7 +82,7 @@ protected override void ProcessRecord()
7082
7183 if ( stringID != null )
7284 {
73- resource = RmcWrapper . Client . GetResource ( stringID , this . AttributesToGet ) ;
85+ resource = RmcWrapper . Client . GetResource ( stringID , this . AttributesToGet , locale ) ;
7486
7587 if ( resource == null )
7688 {
@@ -85,7 +97,7 @@ protected override void ProcessRecord()
8597
8698 if ( guidID != null )
8799 {
88- resource = RmcWrapper . Client . GetResource ( guidID , this . AttributesToGet ) ;
100+ resource = RmcWrapper . Client . GetResource ( guidID , this . AttributesToGet , locale ) ;
89101
90102 if ( resource == null )
91103 {
@@ -98,7 +110,7 @@ protected override void ProcessRecord()
98110
99111 if ( this . AttributeValuePairs != null )
100112 {
101- resource = RmcWrapper . Client . GetResourceByKey ( this . ObjectType , this . HashTableToDictionary ( this . AttributeValuePairs ) , this . AttributesToGet ) ;
113+ resource = RmcWrapper . Client . GetResourceByKey ( this . ObjectType , this . HashTableToDictionary ( this . AttributeValuePairs ) , this . AttributesToGet , locale ) ;
102114
103115 if ( resource == null )
104116 {
@@ -110,7 +122,7 @@ protected override void ProcessRecord()
110122 }
111123 else
112124 {
113- resource = RmcWrapper . Client . GetResourceByKey ( this . ObjectType , this . AttributeName , this . AttributeValue , this . AttributesToGet ) ;
125+ resource = RmcWrapper . Client . GetResourceByKey ( this . ObjectType , this . AttributeName , this . AttributeValue , this . AttributesToGet , locale ) ;
114126
115127 if ( resource == null )
116128 {
0 commit comments