Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
977 B
C#
Raw Permalink Normal View History

2017-06-14 11:06:17 -07:00
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullable disable
2017-06-14 11:06:17 -07:00
using System.Management.Automation;
using Task = System.Threading.Tasks.Task;
namespace API.Test.Cmdlets
{
[Cmdlet(VerbsDiagnostic.Test, "Project")]
[OutputType(typeof(bool))]
public sealed class TestProjectCommand : TestExtensionCmdlet
{
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string UniqueName { get; set; }
protected override async Task ProcessRecordAsync()
{
var project = await VSSolutionHelper.FindProjectByUniqueNameAsync(UniqueName);
if (project == null)
{
throw new ItemNotFoundException($"Project '{UniqueName}' is not found.");
}
WriteObject(true);
}
}
}