Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,6 +20,7 @@ jobs:
Build:

runs-on: windows-latest
if: github.event_name == 'pull_request'
env:
TFSCMDLETS_ACCESS_TOKEN: ${{ secrets.TFSCMDLETS_TOKEN }}
TFSCMDLETS_COLLECTION_URL: 'https://dev.azure.com/tfscmdlets'
Expand Down Expand Up @@ -96,7 +99,7 @@ jobs:
id: extract_release_notes
shell: pwsh
run: |
$fileName = (Get-ChildItem [0-9]*.md -Recurse | Sort-Object Name | Select -ExpandProperty FullName -Last 1)
$fileName = (Get-ChildItem [0-9]*.md -Recurse | Select @{L='Version';E={[Version]$_.BaseName}}, FullName | Sort-Object Version | Select -ExpandProperty FullName -Last 1)
Write-Output $fileName
$releaseNotes = (Get-Content $fileName -Encoding UTF8 | Select-Object -Skip 4)
Write-Output $releaseNotes
Expand Down Expand Up @@ -337,3 +340,23 @@ jobs:
# with:
# status: |
# TfsCmdlets version ${{ env.BUILD_NAME }} has just been released. Check it out! https://github.com/igoravl/TfsCmdlets/releases/tag/v${{ env.RELEASE_TAG }}

PostRelease:

runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update tag
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MESSAGE" =~ \(\#[0-9]+\)$ ]]; then
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git tag -d $LATEST_TAG
git tag $LATEST_TAG $GITHUB_SHA
git push origin :refs/tags/$LATEST_TAG
git push origin $LATEST_TAG
fi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace TfsCmdlets.Cmdlets.ConfigServer
/// Gets one or more Team Foundation Server addresses registered in the current computer.
/// </summary>
[TfsCmdlet(CmdletScope.None, DesktopOnly = true
#if NET471_OR_GREATER
#if NET461_OR_GREATER
, OutputType = typeof(Microsoft.TeamFoundation.Client.RegisteredConfigurationServer)
#endif
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.2.0" />
<!--<PackageReference Include="Microsoft.TeamFoundationServer.ExtendedClient" Version="16.206.0-preview" />-->
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CSharp/TfsCmdlets/AssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class AssemblyResolver
public void Register()
{

#if NET471_OR_GREATER
#if NET461_OR_GREATER
AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
{
var assemblyName = e.Name.Split(',')[0];
Expand Down
26 changes: 26 additions & 0 deletions CSharp/TfsCmdlets/Cmdlets/AutoParameterAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace TfsCmdlets.Cmdlets
{
/// <summary>
/// Defines an automatic parameter.
/// </summary>
/// <remarks>
/// This attribute is used to mark a parameter that should be automatically populated by the underlying
/// infrastructure, typically by fetching an associated resource.
/// </remarks>
public class AutoParameterAttribute: Attribute
{
/// <summary>
/// The type of the parameter
/// </summary>
public Type Type { get; }

/// <summary>
/// Creates a new instance of the AutoParameterAttribute class
/// </summary>
/// <param name="type">The type of the parameter</param>
public AutoParameterAttribute(Type type)
{
Type = type;
}
}
}
10 changes: 4 additions & 6 deletions CSharp/TfsCmdlets/Cmdlets/Credential/NewCredential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,10 @@ protected override IEnumerable Run()

if (netCred == null) yield break;

yield return IsHosted(Url) ?
new VssClientCredentials(
new WindowsCredential(netCred),
new VssBasicCredential(netCred)) :
new VssClientCredentials(
new WindowsCredential(netCred));
yield return new VssClientCredentials(
new WindowsCredential(netCred),
new VssBasicCredential(netCred),
CredentialPromptType.DoNotPrompt);
}

private bool IsHosted(Uri url) => (
Expand Down
5 changes: 0 additions & 5 deletions CSharp/TfsCmdlets/Cmdlets/Pipeline/Build/Definition/index.md

This file was deleted.

32 changes: 0 additions & 32 deletions CSharp/TfsCmdlets/Cmdlets/Pipeline/Build/StartBuild.cs

This file was deleted.

5 changes: 0 additions & 5 deletions CSharp/TfsCmdlets/Cmdlets/Pipeline/Build/index.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Management.Automation;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Definition
namespace TfsCmdlets.Cmdlets.Pipeline
{
/// <summary>
/// Disables a build/pipeline definition.
/// Disables a pipeline.
/// </summary>
[TfsCmdlet(CmdletScope.Project, SupportsShouldProcess = true, OutputType = typeof(BuildDefinitionReference))]
partial class DisableBuildDefinition
partial class DisablePipeline
{
/// <summary>
/// Specifies the pipeline name/path.
Expand All @@ -18,7 +18,7 @@ partial class DisableBuildDefinition
}

[CmdletController(typeof(BuildDefinitionReference), Client=typeof(IBuildHttpClient))]
partial class DisableBuildDefinitionController
partial class DisablePipelineController
{
protected override IEnumerable Run()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Management.Automation;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Definition
namespace TfsCmdlets.Cmdlets.Pipeline
{
/// <summary>
/// Enables a previously disabled build/pipeline definition.
/// Enables a previously disabled pipeline.
/// </summary>
[TfsCmdlet(CmdletScope.Project, SupportsShouldProcess = true, OutputType = typeof(BuildDefinitionReference))]
partial class EnableBuildDefinition
partial class EnablePipeline
{
/// <summary>
/// Specifies the pipeline name/path.
Expand All @@ -18,7 +18,7 @@ partial class EnableBuildDefinition
}

[CmdletController(typeof(BuildDefinitionReference), Client=typeof(IBuildHttpClient))]
partial class EnableBuildDefinitionController
partial class EnablePipelineController
{
protected override IEnumerable Run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
using WebApiFolder = Microsoft.TeamFoundation.Build.WebApi.Folder;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Folder
namespace TfsCmdlets.Cmdlets.Pipeline.Folder
{
/// <summary>
/// Gets one or more build/pipeline definition folders in a team project.
/// </summary>
[TfsCmdlet(CmdletScope.Project, OutputType = typeof(WebApiFolder))]
partial class GetBuildDefinitionFolder
partial class GetPipelineFolder
{
/// <summary>
/// Specifies the folder path. Wildcards are supported.
Expand All @@ -27,7 +27,7 @@ partial class GetBuildDefinitionFolder
}

[CmdletController(typeof(WebApiFolder), Client=typeof(IBuildHttpClient))]
partial class GetBuildDefinitionFolderController
partial class GetPipelineFolderController
{
protected override IEnumerable Run()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Management.Automation;
using WebApiFolder = Microsoft.TeamFoundation.Build.WebApi.Folder;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Folder
namespace TfsCmdlets.Cmdlets.Pipeline.Folder
{
/// <summary>
/// Creates a new build/pipeline definition folder
Expand All @@ -12,7 +12,7 @@ namespace TfsCmdlets.Cmdlets.Pipeline.Build.Folder
/// child folders.
/// </remarks>
[TfsCmdlet(CmdletScope.Project, SupportsShouldProcess = true, OutputType = typeof(WebApiFolder))]
partial class NewBuildDefinitionFolder
partial class NewPipelineFolder
{
/// <summary>
/// Specifies the path of the new pipeline/build folder, including its name,
Expand All @@ -30,12 +30,12 @@ partial class NewBuildDefinitionFolder
}

[CmdletController(typeof(WebApiFolder), Client=typeof(IBuildHttpClient))]
partial class NewBuildDefinitionFolderController
partial class NewPipelineFolderController
{
protected override IEnumerable Run()
{
var folder = Parameters.Get<string>(nameof(NewBuildDefinitionFolder.Folder))?.Trim('\\');
var description = Parameters.Get<string>(nameof(NewBuildDefinitionFolder.Description));
var folder = Parameters.Get<string>(nameof(NewPipelineFolder.Folder))?.Trim('\\');
var description = Parameters.Get<string>(nameof(NewPipelineFolder.Description));

if (string.IsNullOrEmpty(folder))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
using WebApiFolder = Microsoft.TeamFoundation.Build.WebApi.Folder;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Folder
namespace TfsCmdlets.Cmdlets.Pipeline.Folder
{
/// <summary>
/// Deletes one or more build/pipeline definition folders.
/// </summary>
[TfsCmdlet(CmdletScope.Project, SupportsShouldProcess = true, OutputType = typeof(WebApiFolder))]
partial class RemoveBuildDefinitionFolder
partial class RemovePipelineFolder
{
/// <summary>
/// Specifies the path of the pipeline/build folder to delete, including its name,
/// separated by backslashes (\). Wildcards are supperted.
/// separated by backslashes (\). Wildcards are supported.
/// </summary>
[Parameter(Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, Mandatory = true)]
[Alias("Path")]
Expand All @@ -34,13 +34,13 @@ partial class RemoveBuildDefinitionFolder
}

[CmdletController(typeof(WebApiFolder), Client=typeof(IBuildHttpClient))]
partial class RemoveBuildDefinitionFolderController
partial class RemovePipelineFolderController
{
protected override IEnumerable Run()
{
var folders = Data.GetItems<WebApiFolder>();
var recurse = Parameters.Get<bool>(nameof(RemoveBuildDefinitionFolder.Recurse));
var force = Parameters.Get<bool>(nameof(RemoveBuildDefinitionFolder.Force));
var recurse = Parameters.Get<bool>(nameof(RemovePipelineFolder.Recurse));
var force = Parameters.Get<bool>(nameof(RemovePipelineFolder.Force));

foreach (var f in folders)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Management.Automation;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Definition
namespace TfsCmdlets.Cmdlets.Pipeline
{
/// <summary>
/// Gets one or more build/pipeline definitions in a team project.
/// Gets one or more pipelines in a team project.
/// </summary>
[TfsCmdlet(CmdletScope.Project, OutputType = typeof(BuildDefinitionReference))]
partial class GetBuildDefinition
partial class GetPipeline
{
/// <summary>
/// Specifies the pipeline path. Wildcards are supported.
Expand All @@ -26,7 +26,7 @@ partial class GetBuildDefinition
}

[CmdletController(typeof(BuildDefinitionReference), Client=typeof(IBuildHttpClient))]
partial class GetBuildDefinitionController
partial class GetPipelineController
{
[Import]
private INodeUtil NodeUtil { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Management.Automation;
using Microsoft.TeamFoundation.Build.WebApi;

namespace TfsCmdlets.Cmdlets.Pipeline.Build.Definition
namespace TfsCmdlets.Cmdlets.Pipeline
{
/// <summary>
/// Resumes (unpauses) a previously suspended build/pipeline definition.
/// Resumes (unpauses) a previously suspended pipeline.
/// </summary>
[TfsCmdlet(CmdletScope.Project, SupportsShouldProcess = true, OutputType = typeof(BuildDefinitionReference))]
partial class ResumeBuildDefinition
partial class ResumePipeline
{
/// <summary>
/// Specifies the pipeline name/path.
Expand All @@ -18,7 +18,7 @@ partial class ResumeBuildDefinition
}

[CmdletController(typeof(BuildDefinitionReference), Client=typeof(IBuildHttpClient))]
partial class ResumeBuildDefinitionController
partial class ResumePipelineController
{
protected override IEnumerable Run()
{
Expand Down
Loading
Loading