Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Commit

Permalink
Fix issue #17
Browse files Browse the repository at this point in the history
  • Loading branch information
AMSoftwareNL committed Sep 13, 2018
1 parent ef48ed5 commit 5a60540
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.0.7\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.4\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.0.7\lib\net452\Microsoft.Xrm.Sdk.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.4\lib\net452\Microsoft.Xrm.Sdk.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -188,6 +186,7 @@
<None Include="..\AMSoftware.Crm.Powershell.snk">
<Link>AMSoftware.Crm.Powershell.snk</Link>
</None>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Language;
using AMSoftware.Crm.PowerShell.Common;
using AMSoftware.Crm.PowerShell.Common.Helpers;
using AMSoftware.Crm.PowerShell.Common.Repositories;
Expand All @@ -40,6 +42,7 @@ public sealed class AddSolutionComponentCommand : CrmOrganizationCmdlet, IDynami

[Parameter(Mandatory = true, Position = 2)]
[ValidateNotNullOrEmpty]
//[ArgumentCompleter(typeof(ResourceTypeArgumentCompleter))]
public string Type { get; set; }

[Parameter(Mandatory = true, Position = 3)]
Expand Down Expand Up @@ -126,7 +129,33 @@ protected internal override void SetParametersOnRequest(OrganizationRequest requ
base.SetParametersOnRequest(request);

request.Parameters.Add("DoNotIncludeSubcomponents", ExcludeSubComponents.ToBool());
request.Parameters.Add("IncludedComponentSettingsValues", !ExcludeMetadata.ToBool());
request.Parameters.Add("IncludedComponentSettingsValues", ExcludeMetadata.ToBool() ? new string[] { } : null);
}
}

//public class ResourceTypeArgumentCompleter : IArgumentCompleter
//{
// public IEnumerable<CompletionResult> CompleteArgument(string commandName, string parameterName, string wordToComplete, CommandAst commandAst, IDictionary fakeBoundParameters)
// {
// if (fakeBoundParameters == null)
// {
// throw new ArgumentNullException("fakeBoundParameters");
// }

// IEnumerable<KeyValuePair<int, string>> validComponentTypes = new Dictionary<int, string>(SolutionManagementHelper.GetComponentTypes());

// if (!string.IsNullOrWhiteSpace(wordToComplete))
// {
// validComponentTypes = validComponentTypes.Where(k =>
// k.Key.ToString().StartsWith(wordToComplete, StringComparison.InvariantCultureIgnoreCase) ||
// k.Value.StartsWith(wordToComplete, StringComparison.InvariantCultureIgnoreCase));
// }

// var textResult = from type in validComponentTypes
// orderby type.Value
// select new CompletionResult(type.Value, type.Value, CompletionResultType.Text, type.Value);

// return textResult;
// }
//}
}
2 changes: 1 addition & 1 deletion AMSoftware.Crm.PowerShell.Commands/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CrmSdk.CoreAssemblies" version="9.0.0.7" targetFramework="net452" />
<package id="Microsoft.CrmSdk.CoreAssemblies" version="9.0.2.4" targetFramework="net452" />
<package id="Microsoft.IdentityModel" version="6.1.7600.16394" targetFramework="net452" />
<package id="System.Management.Automation.dll" version="10.0.10586.0" targetFramework="net452" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.0.7\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.4\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.0.7\lib\net452\Microsoft.Xrm.Sdk.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.4\lib\net452\Microsoft.Xrm.Sdk.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
Expand Down Expand Up @@ -119,6 +117,7 @@
<None Include="..\AMSoftware.Crm.Powershell.snk">
<Link>AMSoftware.Crm.Powershell.snk</Link>
</None>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
Expand Down
2 changes: 1 addition & 1 deletion AMSoftware.Crm.PowerShell.Common/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CrmSdk.CoreAssemblies" version="9.0.0.7" targetFramework="net452" />
<package id="Microsoft.CrmSdk.CoreAssemblies" version="9.0.2.4" targetFramework="net452" />
<package id="Microsoft.IdentityModel" version="6.1.7600.16394" targetFramework="net452" />
<package id="System.Management.Automation.dll" version="10.0.10586.0" targetFramework="net452" />
</packages>
Binary file modified AMSoftware.Crm.PowerShell/AMSoftware.Crm.psd1
Binary file not shown.
1 change: 1 addition & 0 deletions AMSoftware.Crm.Powershell.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{596F15CE-AC31-4EF0-B3DA-836AF7A58FE0}"
ProjectSection(SolutionItems) = preProject
AMSoftware.Crm.Powershell.snk = AMSoftware.Crm.Powershell.snk
Debug.ps1 = Debug.ps1
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMSoftware.Crm.PowerShell.Common", "AMSoftware.Crm.PowerShell.Common\AMSoftware.Crm.PowerShell.Common.csproj", "{A5D853A6-D872-4EB2-9D90-EE79F02B3469}"
Expand Down
1 change: 1 addition & 0 deletions Debug.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Import-Module '.\AMSoftware.Crm.psd1'

0 comments on commit 5a60540

Please sign in to comment.