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

Commit 9d3e6bb

Browse files
committed
Release v1.4.1.0
Fixed #18 #19 #20 #21 #22
1 parent 5a60540 commit 9d3e6bb

File tree

196 files changed

+1812
-1572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+1812
-1572
lines changed

AMSoftware.Crm.PowerShell.Commands/AMSoftware.Crm.PowerShell.Commands.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135
<Compile Include="Metadata\AddAttributeCommand.cs" />
136136
<Compile Include="Metadata\GetEntityKeyCommand.cs" />
137137
<Compile Include="Metadata\RemoveEntityKeyCommand.cs" />
138-
<Compile Include="Metadata\SetRelationshipCommand.cs" />
139138
<Compile Include="Metadata\SetRelationshipCascadeConfigCommand.cs" />
139+
<Compile Include="Metadata\SetRelationshipCommand.cs" />
140140
<Compile Include="Metadata\NewEntityCommand.cs" />
141141
<Compile Include="Metadata\NewOptionSetCommand.cs" />
142142
<Compile Include="Metadata\AddRelationshipCommand.cs" />
@@ -186,7 +186,6 @@
186186
<None Include="..\AMSoftware.Crm.Powershell.snk">
187187
<Link>AMSoftware.Crm.Powershell.snk</Link>
188188
</None>
189-
<None Include="app.config" />
190189
<None Include="packages.config" />
191190
</ItemGroup>
192191
<ItemGroup>
@@ -199,6 +198,7 @@
199198
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
200199
<PropertyGroup>
201200
<PostBuildEvent>copy "$(SolutionDir)AMSoftware.Crm.PowerShell\*.*" "$(TargetDir)" /Y
201+
copy "$(SolutionDir)debug.ps1" "$(TargetDir)" /Y
202202
del "$(TargetDir)*.xml" /F /Q</PostBuildEvent>
203203
</PropertyGroup>
204204
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

AMSoftware.Crm.PowerShell.Commands/Administration/GetBusinessUnitCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public sealed class GetBusinessUnitCommand : CrmOrganizationCmdlet
3535

3636
[Parameter(Mandatory = true, Position = 0, ParameterSetName = GetBusinessUnitByIdParameterSet, ValueFromPipeline = true)]
3737
[ValidateNotNull]
38-
public Guid Id { get; set; }
38+
public Guid[] Id { get; set; }
3939

4040
[Parameter(ParameterSetName = GetAllBusinessUnitsParameterSet, Position = 0)]
4141
[Alias("Include")]
@@ -62,7 +62,10 @@ protected override void ExecuteCmdlet()
6262
GetFilteredContent();
6363
break;
6464
case GetBusinessUnitByIdParameterSet:
65-
WriteObject(_repository.Get("businessunit", Id));
65+
foreach (Guid id in Id)
66+
{
67+
WriteObject(_repository.Get("businessunit", id));
68+
}
6669
break;
6770
default:
6871
break;

AMSoftware.Crm.PowerShell.Commands/Administration/GetPrincipalRolesCommand.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ public sealed class GetPrincipalRolesCommand : CrmOrganizationCmdlet
3535
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
3636
[Alias("Id")]
3737
[ValidateNotNull]
38-
public Guid Principal { get; set; }
38+
public Guid[] Principal { get; set; }
3939

4040
protected override void ExecuteCmdlet()
4141
{
4242
base.ExecuteCmdlet();
4343

44-
IEnumerable<Entity> teamRoles = SecurityManagementHelper.GetRolesForPrincipal(_repository, CrmPrincipalType.Team, Principal);
45-
WriteObject(teamRoles, true);
44+
foreach (Guid id in Principal)
45+
{
46+
IEnumerable<Entity> teamRoles = SecurityManagementHelper.GetRolesForPrincipal(_repository, CrmPrincipalType.Team, id);
47+
WriteObject(teamRoles, true);
4648

47-
IEnumerable<Entity> userRoles = SecurityManagementHelper.GetRolesForPrincipal(_repository, CrmPrincipalType.User, Principal);
48-
WriteObject(userRoles, true);
49+
IEnumerable<Entity> userRoles = SecurityManagementHelper.GetRolesForPrincipal(_repository, CrmPrincipalType.User, id);
50+
WriteObject(userRoles, true);
51+
}
4952
}
5053
}
5154
}

AMSoftware.Crm.PowerShell.Commands/Administration/GetProcessCommand.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
2222
using AMSoftware.Crm.PowerShell.Common.Repositories;
2323
using Microsoft.Xrm.Sdk;
2424
using Microsoft.Xrm.Sdk.Query;
25+
using AMSoftware.Crm.PowerShell.Common.ArgumentCompleters;
2526

2627
namespace AMSoftware.Crm.PowerShell.Commands.Administration
2728
{
@@ -36,7 +37,7 @@ public sealed class GetProcessCommand : CrmOrganizationCmdlet
3637

3738
[Parameter(Mandatory = true, Position = 0, ParameterSetName = GetProcessByIdParameterSet, ValueFromPipeline = true)]
3839
[ValidateNotNull]
39-
public Guid Id { get; set; }
40+
public Guid[] Id { get; set; }
4041

4142
[Parameter(Mandatory = false, Position = 0, ParameterSetName = GetAllProcessesParameterSet)]
4243
[Alias("Include")]
@@ -51,6 +52,7 @@ public sealed class GetProcessCommand : CrmOrganizationCmdlet
5152

5253
[Parameter(Mandatory = false, Position = 10, ParameterSetName = GetAllProcessesParameterSet)]
5354
[ValidateNotNullOrEmpty]
55+
[ArgumentCompleter(typeof(EntityArgumentCompleter))]
5456
public string Entity { get; set; }
5557

5658
[Parameter(Mandatory = false, Position = 30, ParameterSetName = GetAllProcessesParameterSet)]
@@ -64,7 +66,10 @@ protected override void ExecuteCmdlet()
6466
switch (this.ParameterSetName)
6567
{
6668
case GetProcessByIdParameterSet:
67-
WriteObject(_repository.Get("workflow", Id));
69+
foreach (Guid id in Id)
70+
{
71+
WriteObject(_repository.Get("workflow", id));
72+
}
6873
break;
6974
case GetAllProcessesParameterSet:
7075
GetFilteredContent();

AMSoftware.Crm.PowerShell.Commands/Administration/GetRoleCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public sealed class GetRoleCommand : CrmOrganizationCmdlet
3535

3636
[Parameter(Mandatory = true, Position = 0, ParameterSetName = GetRoleByIdParameterSet, ValueFromPipeline = true)]
3737
[ValidateNotNull]
38-
public Guid Id { get; set; }
38+
public Guid[] Id { get; set; }
3939

4040
[Parameter(Position = 0, ParameterSetName = GetAllRolesParameterSet)]
4141
[Alias("Include")]
@@ -62,7 +62,10 @@ protected override void ExecuteCmdlet()
6262
GetFilteredContent();
6363
break;
6464
case GetRoleByIdParameterSet:
65-
WriteObject(_repository.Get("role", Id));
65+
foreach (Guid id in Id)
66+
{
67+
WriteObject(_repository.Get("role", id));
68+
}
6669
break;
6770
default:
6871
break;

AMSoftware.Crm.PowerShell.Commands/Administration/GetRolePrincipalsCommand.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ public sealed class GetRolePrincipalsCommand : CrmOrganizationCmdlet
3535
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
3636
[Alias("Id")]
3737
[ValidateNotNull]
38-
public Guid Role { get; set; }
38+
public Guid[] Role { get; set; }
3939

4040
protected override void ExecuteCmdlet()
4141
{
4242
base.ExecuteCmdlet();
4343

44-
IEnumerable<Entity> teams = SecurityManagementHelper.GetPrincipalsInRole(_repository, CrmPrincipalType.Team, Role);
45-
WriteObject(teams, true);
44+
foreach (Guid id in Role)
45+
{
46+
IEnumerable<Entity> teams = SecurityManagementHelper.GetPrincipalsInRole(_repository, CrmPrincipalType.Team, id);
47+
WriteObject(teams, true);
4648

47-
IEnumerable<Entity> users = SecurityManagementHelper.GetPrincipalsInRole(_repository, CrmPrincipalType.User, Role);
48-
WriteObject(users, true);
49+
IEnumerable<Entity> users = SecurityManagementHelper.GetPrincipalsInRole(_repository, CrmPrincipalType.User, id);
50+
WriteObject(users, true);
51+
}
4952
}
5053
}
5154
}

AMSoftware.Crm.PowerShell.Commands/Administration/GetTeamCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public sealed class GetTeamCommand : CrmOrganizationCmdlet
3636

3737
[Parameter(Mandatory = true, Position = 0, ParameterSetName = GetTeamByIdParameterSet, ValueFromPipeline = true)]
3838
[ValidateNotNull]
39-
public Guid Id { get; set; }
39+
public Guid[] Id { get; set; }
4040

4141
[Parameter(Position = 0, ParameterSetName = GetAllTeamsParameterSet)]
4242
[Alias("Include")]
@@ -71,7 +71,10 @@ protected override void ExecuteCmdlet()
7171
GetFilteredContent();
7272
break;
7373
case GetTeamByIdParameterSet:
74-
WriteObject(_repository.Get("team", Id));
74+
foreach (Guid id in Id)
75+
{
76+
WriteObject(_repository.Get("team", id));
77+
}
7578
break;
7679
default:
7780
break;

AMSoftware.Crm.PowerShell.Commands/Administration/GetTeamUsersCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ public sealed class GetTeamUsersCommand : CrmOrganizationCmdlet
3232
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
3333
[Alias("Id")]
3434
[ValidateNotNull]
35-
public Guid Team { get; set; }
35+
public Guid[] Team { get; set; }
3636

3737
protected override void ExecuteCmdlet()
3838
{
3939
base.ExecuteCmdlet();
40-
WriteObject(SecurityManagementHelper.GetUsersInTeam(_repository, Team), true);
40+
foreach (Guid id in Team)
41+
{
42+
WriteObject(SecurityManagementHelper.GetUsersInTeam(_repository, id), true);
43+
}
4144
}
4245
}
4346
}

AMSoftware.Crm.PowerShell.Commands/Administration/GetUserCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public sealed class GetUserCommand : CrmOrganizationCmdlet
3535

3636
[Parameter(Mandatory = true, Position = 0, ParameterSetName = GetUserByIdParameterSet, ValueFromPipeline = true)]
3737
[ValidateNotNull]
38-
public Guid Id { get; set; }
38+
public Guid[] Id { get; set; }
3939

4040
[Parameter(Position = 0, ParameterSetName = GetAllUsersParameterSet)]
4141
[Alias("Include")]
@@ -65,7 +65,10 @@ protected override void ExecuteCmdlet()
6565
GetFilteredContent();
6666
break;
6767
case GetUserByIdParameterSet:
68-
WriteObject(_repository.Get("systemuser", Id));
68+
foreach (Guid id in Id)
69+
{
70+
WriteObject(_repository.Get("systemuser", id));
71+
}
6972
break;
7073
default:
7174
break;

AMSoftware.Crm.PowerShell.Commands/Administration/GetUserTeamsCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ public sealed class GetUserTeamsCommand : CrmOrganizationCmdlet
3232
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
3333
[Alias("Id")]
3434
[ValidateNotNull]
35-
public Guid User { get; set; }
35+
public Guid[] User { get; set; }
3636

3737
protected override void ExecuteCmdlet()
3838
{
3939
base.ExecuteCmdlet();
40-
WriteObject(SecurityManagementHelper.GetTeamsForUser(_repository, User), true);
40+
41+
foreach (Guid id in User)
42+
{
43+
WriteObject(SecurityManagementHelper.GetTeamsForUser(_repository, id), true);
44+
}
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)