Skip to content

Commit

Permalink
Merge locale-support into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ryannewington committed Jul 23, 2016
2 parents 12a9422 + da38302 commit bd89453
Show file tree
Hide file tree
Showing 12 changed files with 336 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Product Id="*"
Name="Lithnet FIM/MIM Service PowerShell Module"
Language="1033"
Version="1.0.6022"
Version="1.0.6048"
Manufacturer="Lithnet"
UpgradeCode="CC6C89F6-8663-46ED-A792-15B1327D8AA8">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
Expand Down
22 changes: 17 additions & 5 deletions src/Lithnet.ResourceManagement.Automation/GetResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.ResourceManagement.WebServices;
using System.Collections;
using Lithnet.ResourceManagement.Client;
using System.Globalization;

namespace Lithnet.ResourceManagement.Automation
{
Expand Down Expand Up @@ -47,15 +48,26 @@ public class GetResource : PSCmdlet //, IDynamicParameters
[Parameter(ParameterSetName = "GetResource", Mandatory = false, Position = 2)]
public string[] AttributesToGet { get; set; }

[Parameter(ParameterSetName = "GetResourceByKey", Mandatory = false, Position = 5)]
[Parameter(ParameterSetName = "GetResourceByKeys", Mandatory = false, Position = 4)]
[Parameter(ParameterSetName = "GetResource", Mandatory = false, Position = 3)]
public string Locale { get; set; }

protected override void ProcessRecord()
{
ResourceObject resource;
CultureInfo locale = null;

if (this.Locale != null)
{
locale = new CultureInfo(this.Locale);
}

UniqueIdentifier uniqueID = this.ID as UniqueIdentifier;

if (uniqueID != null)
{
resource = RmcWrapper.Client.GetResource(uniqueID, this.AttributesToGet);
resource = RmcWrapper.Client.GetResource(uniqueID, this.AttributesToGet, locale);

if (resource == null)
{
Expand All @@ -70,7 +82,7 @@ protected override void ProcessRecord()

if (stringID != null)
{
resource = RmcWrapper.Client.GetResource(stringID, this.AttributesToGet);
resource = RmcWrapper.Client.GetResource(stringID, this.AttributesToGet, locale);

if (resource == null)
{
Expand All @@ -85,7 +97,7 @@ protected override void ProcessRecord()

if (guidID != null)
{
resource = RmcWrapper.Client.GetResource(guidID, this.AttributesToGet);
resource = RmcWrapper.Client.GetResource(guidID, this.AttributesToGet, locale);

if (resource == null)
{
Expand All @@ -98,7 +110,7 @@ protected override void ProcessRecord()

if (this.AttributeValuePairs != null)
{
resource = RmcWrapper.Client.GetResourceByKey(this.ObjectType, this.HashTableToDictionary(this.AttributeValuePairs), this.AttributesToGet);
resource = RmcWrapper.Client.GetResourceByKey(this.ObjectType, this.HashTableToDictionary(this.AttributeValuePairs), this.AttributesToGet, locale);

if (resource == null)
{
Expand All @@ -110,7 +122,7 @@ protected override void ProcessRecord()
}
else
{
resource = RmcWrapper.Client.GetResourceByKey(this.ObjectType, this.AttributeName, this.AttributeValue, this.AttributesToGet);
resource = RmcWrapper.Client.GetResourceByKey(this.ObjectType, this.AttributeName, this.AttributeValue, this.AttributesToGet, locale);

if (resource == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.ResourceManagement.Automation</RootNamespace>
<AssemblyName>Lithnet.ResourceManagement.Automation</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand All @@ -35,13 +35,13 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Lithnet.ResourceManagement.Client, Version=1.0.6039.27655, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.ResourceManagement.Client.1.0.6039.27655\lib\net40\Lithnet.ResourceManagement.Client.dll</HintPath>
<Reference Include="Lithnet.ResourceManagement.Client, Version=1.0.6048.17046, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.ResourceManagement.Client.1.0.6048.17046\lib\net40\Lithnet.ResourceManagement.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ResourceManagement">
<Reference Include="Microsoft.ResourceManagement, Version=4.1.3451.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Microsoft.ResourceManagement.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -113,7 +113,9 @@
<None Include="Examples\Variables.xml">
<SubType>Designer</SubType>
</None>
<None Include="LithnetRMA.Help.pshproj" />
<None Include="LithnetRMA.Help.pshproj">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand All @@ -124,12 +126,12 @@
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<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')" />
<Import Project="..\packages\Fody.1.29.2\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.2\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<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'))" />
<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'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Loading

0 comments on commit bd89453

Please sign in to comment.