diff --git a/powershell/generators/gitignore.ts b/powershell/generators/gitignore.ts index 783cae2547..d4dd530ff8 100644 --- a/powershell/generators/gitignore.ts +++ b/powershell/generators/gitignore.ts @@ -17,9 +17,7 @@ tools custom/*.psm1 custom/autogen-model-cmdlets test/*-TestResults.xml -license.txt /*.ps1 -/*.psd1 /*.ps1xml /*.psm1 /*.snk diff --git a/powershell/internal/project.ts b/powershell/internal/project.ts index 2bafb2af86..1748c67d10 100644 --- a/powershell/internal/project.ts +++ b/powershell/internal/project.ts @@ -142,7 +142,6 @@ export class Project extends codeDomProject { public uxFolder!: string; public serviceName!: string; public moduleName!: string; - public title!: string; public rootModuleName!: string; public csproj!: string; public nuspec!: string; @@ -152,10 +151,6 @@ export class Project extends codeDomProject { public readme!: string; public afterBuildTasksPath!: string; public afterBuildTasksArgs!: string; - public assemblyInfoFolder!: string; - public assemblyCompany!: string; - public assemblyProduct!: string; - public assemblyCopyright!: string; public dllName!: string; public dll!: string; public psd1!: string; @@ -289,7 +284,6 @@ export class Project extends codeDomProject { this.serviceName = this.model.language.default.serviceName; this.subjectPrefix = this.model.language.default.subjectPrefix; this.moduleName = await this.state.getValue('module-name'); - this.title = await this.state.getValue('title'); this.rootModuleName = await this.state.getValue('root-module-name', ''); this.dllName = await this.state.getValue('dll-name'); // Azure PowerShell data plane configuration @@ -346,11 +340,6 @@ export class Project extends codeDomProject { const afterBuildTasksArgsDictionary: Dictionary = await this.state.getValue>('after-build-tasks-args', {}); this.afterBuildTasksArgs = JSON.stringify(afterBuildTasksArgsDictionary); - this.assemblyInfoFolder = await this.state.getValue('assemblyInfo-folder', ''); - this.assemblyCompany = await this.state.getValue('assembly-company', ''); - this.assemblyProduct = await this.state.getValue('assembly-product', ''); - this.assemblyCopyright = await this.state.getValue('assembly-copyright', ''); - // excluded properties in table view const excludedList = >( values( diff --git a/powershell/plugins/powershell-v2.ts b/powershell/plugins/powershell-v2.ts index 8d3da9fac1..a68a95a722 100644 --- a/powershell/plugins/powershell-v2.ts +++ b/powershell/plugins/powershell-v2.ts @@ -126,9 +126,6 @@ export async function powershellV2(service: Host | TspHost, state?: ModelState

- diff --git a/powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs b/powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs index 744765b600..b3833ffb92 100644 --- a/powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs @@ -149,8 +149,7 @@ protected override void ProcessRecord() else { var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); - if (!String.IsNullOrEmpty(aliasesList)) - { + if (!String.IsNullOrEmpty(aliasesList)) { sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); } } diff --git a/powershell/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs b/powershell/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs deleted file mode 100644 index 1c65c130b4..0000000000 --- a/powershell/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +++ /dev/null @@ -1,64 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -using System; -using System.IO; -using System.Linq; -using System.Management.Automation; -using System.Text; - -namespace Microsoft.Rest.ClientRuntime.PowerShell -{ - [Cmdlet("New", "AssemblyInfo")] - [DoNotExport] - public class NewAssemblyInfo : PSCmdlet - { - private readonly string assemblyInfoPath = Path.Combine("${$project.baseFolder}", "Properties", "AssemblyInfo.cs"); - private const string assemblyName = "${$project.title}"; - private const string assemblyVersion = "${$project.moduleVersion}"; - private const string assemblyCompanyName = "${$project.assemblyCompany}"; - private const string assemblyProduct = "${$project.assemblyProduct}"; - private const string assemblyCopyright = "${$project.assemblyCopyright}"; - protected override void ProcessRecord() - { - try - { - if (File.Exists(assemblyInfoPath)) - { - return; - } - StringBuilder sb = new StringBuilder(); - sb.AppendLine(@" -# ---------------------------------------------------------------------------------- -${$project.pwshCommentHeaderForCsharp} -# ---------------------------------------------------------------------------------- -"); - sb.Append($"{Environment.NewLine}"); - sb.AppendLine("using System;"); - sb.AppendLine("using System.Reflection;"); - sb.AppendLine("using System.Runtime.InteropServices;"); - sb.Append($"{Environment.NewLine}"); - sb.AppendLine($"[assembly: AssemblyTitle(\"Microsoft Azure Powershell - {assemblyName}\")]"); - sb.AppendLine($"[assembly: AssemblyCompany(\"{assemblyCompanyName}\")]"); - sb.AppendLine($"[assembly: AssemblyProduct(\"{assemblyProduct}\")]"); - sb.AppendLine($"[assembly: AssemblyCopyright(\"{assemblyCopyright}\")]"); - sb.Append($"{Environment.NewLine}"); - sb.AppendLine("[assembly: ComVisible(false)]"); - sb.AppendLine("[assembly: CLSCompliant(false)]"); - sb.AppendLine($"[assembly: Guid(\"{Guid.NewGuid()}\")]"); - sb.AppendLine($"[assembly: AssemblyVersion(\"{assemblyVersion}\")]"); - sb.Append($"[assembly: AssemblyFileVersion(\"{assemblyVersion}\")]"); - - FileInfo assemblyInfo = new FileInfo(assemblyInfoPath); - assemblyInfo.Directory.Create(); - File.WriteAllText(assemblyInfo.FullName, sb.ToString()); - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } - } - } -} \ No newline at end of file