Compare commits
4 Commits
documentat
...
7f856b1d09
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f856b1d09 | |||
| 31b56c75e1 | |||
| 7f0d14fc25 | |||
| 00975bb1c5 |
21
Jenkinsfile
vendored
Normal file
21
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label '.net7.0'
|
||||
}
|
||||
stages {
|
||||
stage('Build classlib') {
|
||||
steps {
|
||||
sh '''cd classlib
|
||||
dotnet build --no-incremental --force --configuration Release
|
||||
dotnet publish -c Release'''
|
||||
|
||||
contentReplace(configs: [fileContentReplaceConfig(configs: [fileContentReplaceItemConfig(replace: 'ModuleVersion = \'2.0.$BUILD_NUMBER\'', search: 'ModuleVersion = \'2.0\'')], fileEncoding: 'UTF-8', filePath: 'ps.ipam.psd1')])
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts artifacts: 'classlib/bin/Release/netstandard2.1/publish/*.dll, *.psd1, *.psm1, LICENSE, **/*.ps1xml, **/*.ps1', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,16 +47,28 @@ function New-Address {
|
||||
Port.
|
||||
#>
|
||||
[OutputType([PS.IPAM.address])]
|
||||
[CmdletBinding()]
|
||||
[CmdletBinding(DefaultParameterSetName="BySubnetId")]
|
||||
param (
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0)]
|
||||
Position=0,
|
||||
ParameterSetName="BySubnetId"
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[int]
|
||||
$SubnetId,
|
||||
[Parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0,
|
||||
ParameterSetName="BySubnetObject"
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[ps.ipam.subnetwork]
|
||||
$SubnetObject,
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
@@ -175,8 +187,19 @@ function New-Address {
|
||||
Method = "POST"
|
||||
}
|
||||
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
"BySubnetId" {
|
||||
$_subnetId = $SubnetId
|
||||
break
|
||||
}
|
||||
"BySubnetObject" {
|
||||
$_subnetId = $SubnetObject.id
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$_body = @{
|
||||
subnetId = $SubnetId
|
||||
subnetId = $_subnetId
|
||||
ip = $Ip
|
||||
}
|
||||
if ($Gateway) { $_body.Add("is_gateway", "1") }
|
||||
|
||||
Reference in New Issue
Block a user