forked from zijianhuang/webapiclientgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateClientApi.ps1
21 lines (18 loc) · 931 Bytes
/
CreateClientApi.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#Launch WebApi Website and POST a request for generating client APIs. This only works with the DEBUG build of the Web service.
cd $PSScriptRoot
$arguments = "/site:DemoWebApi /apppool:Clr4IntegratedAppPool /config:$PSScriptRoot\.vs\config\applicationhost.config"
echo $arguments
$procArgs = @{
FilePath = "C:\Program Files (x86)\IIS Express\iisexpress.exe"
ArgumentList = $arguments
PassThru = $true
}
$process = Start-Process @procArgs
Invoke-RestMethod http://localhost:10965/api/codegen -Method POST -InFile "$($PSScriptRoot)\DemoWebApi\CodeGen.json" -ContentType "application/json"
$procTscArgs = @{
FilePath = "C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.6\tsc.exe"
ArgumentList = "$PSScriptRoot\DemoWebApi\Scripts\ClientApi\WebApiClientAuto.ts"
PassThru = $true
}
$processTsc = Start-Process @procTscArgs
Stop-Process $process