Last active
May 12, 2022 02:11
-
-
Save mtemel123/95602d31625a668bf72dff7d2681bc11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cd D:\code\22 ==> myrepo | |
$projecttype=2 #1-) console 2-) web | |
$url="https://github.com/dodyg/practical-aspnetcore/blob/net6.0/projects/connection-info/Program.cs" | |
if($args.length -ne 0) { | |
$projecttype=$args[0] | |
$url=$args[1] | |
} | |
$pn ='del_project' #project name | |
$url = $url.replace('https://github','https://raw.githubusercontent').Replace('/blob','') | |
if (Test-Path -Path $pn) { | |
$g= new-guid | |
$g= "_" + $g | |
$pn=$pn+$g | |
} | |
if($projecttype -eq 1){ $projecttype='console'} else {$projecttype='web'} | |
$content= (Invoke-webrequest -URI "$url").Content | |
mkdir $pn | |
cd .\$pn\ | |
dotnet new $projecttype --name $pn | |
"//$projecttype `n" + $content > .\$pn\Program.cs | |
dotnet new sln --name $pn | |
dotnet sln add $pn | |
start devenv .\$pn.sln | |
cls | |
exit | |
#ex vs-fast-open-github.ps1 2 https://github.com/dodyg/practical-aspnetcore/blob/net6.0/projects/response/response-header/Program.cs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment