text ASPNetCore内置Powershell

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text ASPNetCore内置Powershell相关的知识,希望对你有一定的参考价值。

param(
   [string]$AppName ,
   [string]$artifactPath = "E:\Artifacts" 
  
)



Get-ChildItem -Recurse -Hidden -Path .



$nuspec = @"
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>__appName__</id>
    <version>__appVersion__</version>
    <title>__appName__</title>
    <authors>Gaetan Jaminon</authors>
    <owners>Gaetan Jaminon</owners>
    <licenseUrl>http://www.wtfpl.net/</licenseUrl>
    <projectUrl>http://www.asp.net</projectUrl>
    <iconUrl>http://proget.aesondev.cloud/endpoints/Logo/content/asp-net-core-logo.png</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description> DevOps Demo app</description>
    <summary>Devops Demo App</summary>
    <releaseNotes></releaseNotes>
    <tags>DevOps</tags>
    <packageSourceUrl>http://proget.aesondev.cloud</packageSourceUrl>
    <docsUrl>http://proget.aesondev.cloud</docsUrl>   
  </metadata>
</package>
"@

Write-Output "Getting Version with GitVersion ..."

$version = gitversion | ConvertFrom-Json
$versionName = $version.FullSemVer.Replace('+','.')
Write-Output $version


Write-Output "Set version $versionName for $AppName in nuspec"
$nuspec = $nuspec.Replace('__appName__',$AppName)
$nuspec = $nuspec.Replace('__appVersion__',$versionName)



$appArtifactPath = "$artifactPath\$AppName\$versionName"
Write-Output "Creating artifacts folder $appArtifactPath" 
New-Item -ItemType Directory -Path $appArtifactPath -Force


$publishPath = "$appArtifactPath\source\"
Write-Output "Creating publish folder $publishPath "
New-Item -ItemType Directory -Path $publishPath -Force

Set-Location "./$AppName"

Get-Location


dotnet restore 



dotnet build /p:Major="$version.Major" /p:Minor"$version.Minor" /p:patch="$version.Patch" /p:buildnumber="$version.BuildMetaDataPadded" 

dotnet publish --output "$publishPath" --no-restore --no-build 



$nuspecPath = "$appArtifactPath\$AppName.nuspec"
Write-Output "Generating the .nuspec file $nuspecPath"
New-Item -Path $nuspecPath  -Force
Set-Content $nuspecPath -Value $nuspec -Force


Write-Output "Genrating the choco package in $appArtifactPath "
Set-Location $appArtifactPath
choco pack


$chocoFeed = "http://proget.aesondev.cloud/nuget/Applications/"
Write-Output "Pushig the packahe to $chocoFeed"
choco push --source=$chocoFeed --api-key=Admin:Admin --force


Pop-Location

以上是关于text ASPNetCore内置Powershell的主要内容,如果未能解决你的问题,请参考以下文章

PowerShe 使用证书签名 ll脚本

sql Powershell Migration工具http://stackingcode.com/blog/2011/10/12/database-migrations-with-powershel

powershell 来自https://stackoverflow.com/questions/31051103/how-to-export-a-class-in-powershell-v5-mod

在AspNetCore 中 使用Redis实现分布式缓存

复选框单击 Razor 页面 AspNetCore 2.2 中的表单提交

开发短网址平台的思路