Skip to content

Commit bd89453

Browse files
committed
Merge locale-support into master
2 parents 12a9422 + da38302 commit bd89453

File tree

12 files changed

+336
-52
lines changed

12 files changed

+336
-52
lines changed

src/Lithnet.ResourceManagement.Automation.Installer/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Product Id="*"
55
Name="Lithnet FIM/MIM Service PowerShell Module"
66
Language="1033"
7-
Version="1.0.6022"
7+
Version="1.0.6048"
88
Manufacturer="Lithnet"
99
UpgradeCode="CC6C89F6-8663-46ED-A792-15B1327D8AA8">
1010
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

src/Lithnet.ResourceManagement.Automation/GetResource.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.ResourceManagement.WebServices;
88
using System.Collections;
99
using Lithnet.ResourceManagement.Client;
10+
using System.Globalization;
1011

1112
namespace 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
{

src/Lithnet.ResourceManagement.Automation/Lithnet.ResourceManagement.Automation.csproj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Lithnet.ResourceManagement.Automation</RootNamespace>
1111
<AssemblyName>Lithnet.ResourceManagement.Automation</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<NuGetPackageImportStamp>
1515
</NuGetPackageImportStamp>
@@ -35,13 +35,13 @@
3535
<Prefer32Bit>false</Prefer32Bit>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Lithnet.ResourceManagement.Client, Version=1.0.6039.27655, Culture=neutral, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Lithnet.ResourceManagement.Client.1.0.6039.27655\lib\net40\Lithnet.ResourceManagement.Client.dll</HintPath>
38+
<Reference Include="Lithnet.ResourceManagement.Client, Version=1.0.6048.17046, Culture=neutral, processorArchitecture=MSIL">
39+
<HintPath>..\packages\Lithnet.ResourceManagement.Client.1.0.6048.17046\lib\net40\Lithnet.ResourceManagement.Client.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
42-
<Reference Include="Microsoft.ResourceManagement">
42+
<Reference Include="Microsoft.ResourceManagement, Version=4.1.3451.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43+
<SpecificVersion>False</SpecificVersion>
4344
<HintPath>..\..\..\lib\Microsoft.ResourceManagement.dll</HintPath>
44-
<Private>True</Private>
4545
</Reference>
4646
<Reference Include="System" />
4747
<Reference Include="System.Core" />
@@ -113,7 +113,9 @@
113113
<None Include="Examples\Variables.xml">
114114
<SubType>Designer</SubType>
115115
</None>
116-
<None Include="LithnetRMA.Help.pshproj" />
116+
<None Include="LithnetRMA.Help.pshproj">
117+
<SubType>Designer</SubType>
118+
</None>
117119
<None Include="packages.config" />
118120
</ItemGroup>
119121
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -124,12 +126,12 @@
124126
<PreBuildEvent>
125127
</PreBuildEvent>
126128
</PropertyGroup>
127-
<Import Project="..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
129+
<Import Project="..\packages\Fody.1.29.2\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.2\build\dotnet\Fody.targets')" />
128130
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
129131
<PropertyGroup>
130132
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
131133
</PropertyGroup>
132-
<Error Condition="!Exists('..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets'))" />
134+
<Error Condition="!Exists('..\packages\Fody.1.29.2\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.2\build\dotnet\Fody.targets'))" />
133135
</Target>
134136
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
135137
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)