Skip to content

Commit c4b6626

Browse files
Reports, Multilanguage Action Pack Azure
1 parent e135a19 commit c4b6626

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1166
-588
lines changed

Azure/Billing/Get-AzConsumptionUsageDetails.ps1

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,46 @@
2020
Requires Library script AzureAzLibrary.ps1
2121
2222
.LINK
23-
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Billing
24-
25-
.Parameter AzureCredential
26-
The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials
27-
28-
.Parameter Tenant
29-
Tenant name or ID
23+
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Billing
3024
3125
.Parameter MaxCount
32-
Determine the maximum number of records to return
26+
[sr-en] Determine the maximum number of records to return
27+
[sr-de] Maximale Anzahl der zurückzugebenden Datensätze
3328
3429
.Parameter Tag
35-
The tag of the usages to filter
30+
[sr-en] The tag of the usages to filter
31+
[sr-de] Tag der Verwendungen
3632
3733
.Parameter BillingPeriodName
38-
Name of a specific billing period to get the usage details that associate with
34+
[sr-en] Name of a specific billing period to get the usage details that associate with
35+
[sr-de] Name eines bestimmten Abrechnungszeitraums
3936
4037
.Parameter IncludeMeterDetails
41-
Include meter details in the usages
38+
[sr-en] Include meter details in the usages
39+
[sr-de] Zählerdetails der Verwendungen
4240
4341
.Parameter IncludeAdditionalProperties
44-
Include additional properties in the usages
42+
[sr-en] Include additional properties in the usages
43+
[sr-de] Zusätzliche Eigenschaften der Verwendungen
4544
4645
.Parameter StartDate
47-
The start date of the usages to filter.
46+
[sr-en] The start date of the usages to filter
47+
[sr-de] Das Startdatum der Verwendungen
4848
4949
.Parameter EndDate
50-
The end date of the usages to filter.
50+
[sr-en] The end date of the usages to filter
51+
[sr-de] Das Enddatum der Verwendungen
5152
5253
.Parameter InstanceName
53-
The instance name of the usages to filter
54-
54+
[sr-en] The instance name of the usages to filter
55+
[sr-de] Instanzname der Verwendungen
56+
57+
.Parameter Properties
58+
[sr-en] List of properties to expand. Use * for all properties
59+
[sr-de] Liste der zu anzuzeigenden Eigenschaften. Verwenden Sie * für alle Eigenschaften
5560
#>
5661

5762
param(
58-
[Parameter(Mandatory = $true)]
59-
[pscredential]$AzureCredential,
6063
[string]$BillingPeriodName,
6164
[switch]$IncludeMeterDetails,
6265
[switch]$IncludeAdditionalProperties,
@@ -65,14 +68,16 @@ param(
6568
[datetime]$StartDate,
6669
[datetime]$EndDate,
6770
[string]$InstanceName,
68-
[string]$Tenant
71+
[ValidateSet('*','UsageStart','UsageEnd','BillingPeriodName','InstanceName')]
72+
[string[]]$Properties = @('UsageStart','UsageEnd','BillingPeriodName','InstanceName')
6973
)
7074

7175
Import-Module Az
7276

7377
try{
74-
# ConnectAzure -AzureCredential $AzureCredential -Tenant $Tenant
75-
78+
if($Properties -contains '*'){
79+
$Properties = @('*')
80+
}
7681
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
7782
'IncludeMeterDetails' =$IncludeMeterDetails
7883
'IncludeAdditionalProperties' =$IncludeAdditionalProperties}
@@ -96,7 +101,7 @@ try{
96101
$cmdArgs.Add('EndDate',$EndDate.ToUniversalTime())
97102
}
98103

99-
$ret = Get-AzConsumptionUsageDetail @cmdArgs | Sort-Object Usagestart -Descending
104+
$ret = Get-AzConsumptionUsageDetail @cmdArgs | Sort-Object Usagestart -Descending | Select-Object $Properties
100105

101106
if($SRXEnv) {
102107
$SRXEnv.ResultMessage = $ret
@@ -109,5 +114,4 @@ catch{
109114
throw
110115
}
111116
finally{
112-
# DisconnectAzure -Tenant $Tenant
113117
}

Azure/Compute/Get-AzVMSize.ps1

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,27 @@
2020
Requires Library script AzureAzLibrary.ps1
2121
2222
.LINK
23-
https://github.com/scriptrunner/ActionPacks/blob/master/Azure
23+
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Compute
2424
25-
.Parameter AzureCredential
26-
The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials
27-
28-
.Parameter Tenant
29-
Tenant name or ID
30-
31-
.Parameter VMName
32-
Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing
25+
.Parameter VMName
26+
[sr-en] Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing
27+
[sr-de] Name der virtuellen Maschine
3328
3429
.Parameter ResourceGroupName
35-
Specifies the name of the resource group of the virtual machine
30+
[sr-en] Specifies the name of the resource group of the virtual machine
31+
[sr-de] Name der resource group die die virtuelle Maschine enthält
3632
#>
3733

3834
param(
39-
[Parameter(Mandatory = $true)]
40-
[pscredential]$AzureCredential,
4135
[Parameter(Mandatory = $true)]
4236
[string]$ResourceGroupName,
4337
[Parameter(Mandatory = $true)]
44-
[string]$VMName,
45-
[string]$Tenant
38+
[string]$VMName
4639
)
4740

4841
Import-Module Az
4942

5043
try{
51-
# ConnectAzure -AzureCredential $AzureCredential -Tenant $Tenant
52-
5344
$vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $VMName -ErrorAction Stop
5445
$ret = $vm.HardwareProfile.VmSize
5546

@@ -64,5 +55,4 @@ catch{
6455
throw
6556
}
6657
finally{
67-
# DisconnectAzure -Tenant $Tenant
6858
}

Azure/Compute/Get-AzVMSizes.ps1

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,33 @@
2020
Requires Library script AzureAzLibrary.ps1
2121
2222
.LINK
23-
https://github.com/scriptrunner/ActionPacks/blob/master/Azure
23+
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Compute
2424
25-
.Parameter AzureCredential
26-
The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials
25+
.Parameter VMName
26+
[sr-en] Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing
27+
[sr-de] Name der virtuellen Maschine
2728
28-
.Parameter Tenant
29-
Tenant name or ID
30-
31-
.Parameter VMName
32-
Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing
33-
34-
.Parameter Location
35-
Specifies the location for which this cmdlet gets the available virtual machine sizes
29+
.Parameter Location
30+
[sr-en] Specifies the location for which this cmdlet gets the available virtual machine sizes
31+
[sr-de] Location der virtuellen Maschine
3632
3733
.Parameter ResourceGroupName
38-
Specifies the name of the resource group of the virtual machine
34+
[sr-en] Specifies the name of the resource group of the virtual machine
35+
[sr-de] Name der resource group die die virtuelle Maschine enthält
3936
#>
4037

4138
param(
42-
[Parameter(Mandatory = $true,ParameterSetName = "Location")]
43-
[Parameter(Mandatory = $true,ParameterSetName = "Resource group")]
44-
[pscredential]$AzureCredential,
4539
[Parameter(Mandatory = $true,ParameterSetName = "Resource group")]
4640
[string]$ResourceGroupName,
4741
[Parameter(Mandatory = $true,ParameterSetName = "Resource group")]
4842
[string]$VMName,
4943
[Parameter(Mandatory = $true,ParameterSetName = "Location")]
50-
[string]$Location,
51-
[Parameter(ParameterSetName = "Location")]
52-
[Parameter(ParameterSetName = "Resource group")]
53-
[string]$Tenant
44+
[string]$Location
5445
)
5546

5647
Import-Module Az
5748

5849
try{
59-
# ConnectAzure -AzureCredential $AzureCredential -Tenant $Tenant
60-
6150
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'}
6251

6352
if($PSCmdlet.ParameterSetName -eq "Resource group"){
@@ -83,5 +72,4 @@ catch{
8372
throw
8473
}
8574
finally{
86-
# DisconnectAzure -Tenant $Tenant
8775
}

Azure/Compute/Get-AzVMs.ps1

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,38 @@
2020
Requires Library script AzureAzLibrary.ps1
2121
2222
.LINK
23-
https://github.com/scriptrunner/ActionPacks/blob/master/Azure
23+
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Compute
2424
25-
.Parameter AzureCredential
26-
The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials
25+
.Parameter Name
26+
[sr-en] Specifies the name of the virtual machine to get
27+
[sr-de] Name der virtuellen Maschine
2728
28-
.Parameter Tenant
29-
Tenant name or ID
30-
31-
.Parameter Name
32-
Specifies the name of the virtual machine to get
33-
34-
.Parameter Location
35-
Specifies a location for the virtual machines to list
29+
.Parameter Location
30+
[sr-en] Specifies a location for the virtual machines to list
31+
[sr-de] Location die die virtuelle Maschine enthält
3632
3733
.Parameter ResourceGroupName
38-
Specifies the name of a resource group. Mandatory when parameter name is set!
34+
[sr-en] Specifies the name of the resource group of the virtual machine
35+
Mandatory when parameter name is set!
36+
[sr-de] Name der resource group die die virtuelle Maschine enthält
37+
Mandatory, wenn der Parameter Name angegeben wird
3938
4039
.Parameter Properties
41-
List of properties to expand, comma separated e.g. Name,Location. Use * for all properties
40+
[sr-en] List of properties to expand. Use * for all properties
41+
[sr-de] Liste der zu anzuzeigenden Eigenschaften. Verwenden Sie * für alle Eigenschaften
4242
#>
4343

4444
param(
45-
[Parameter(Mandatory = $true)]
46-
[pscredential]$AzureCredential,
4745
[string]$Name,
4846
[string]$ResourceGroupName,
4947
[string]$Location,
5048
[ValidateSet('*','Name', 'Location', 'ResourceGroupName', 'Tags', 'VmId', 'StatusCode', 'ID')]
51-
[string[]]$Properties = @('Name', 'Location', 'ResourceGroupName', 'Tags', 'VmId', 'StatusCode', 'ID'),
52-
[string]$Tenant
49+
[string[]]$Properties = @('Name', 'Location', 'ResourceGroupName', 'Tags', 'VmId', 'StatusCode', 'ID')
5350
)
5451

5552
Import-Module Az
5653

5754
try{
58-
# ConnectAzure -AzureCredential $AzureCredential -Tenant $Tenant
5955
if($Properties -contains '*'){
6056
$Properties = @('*')
6157
}
@@ -82,5 +78,4 @@ catch{
8278
throw
8379
}
8480
finally{
85-
# DisconnectAzure -Tenant $Tenant
8681
}

Azure/Compute/Invoke-AzVMCommand.ps1

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,34 @@
2020
Requires Module Az
2121
2222
.LINK
23-
https://github.com/scriptrunner/ActionPacks/blob/master/Azure
24-
25-
.Parameter AzureCredential
26-
The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials
27-
28-
.Parameter Tenant
29-
Tenant name or ID
23+
https://github.com/scriptrunner/ActionPacks/blob/master/Azure/Compute
3024
3125
.Parameter Name
32-
Specifies the name of the Azure virtual machine
26+
[sr-en] Specifies the name of the virtual machine
27+
[sr-de] Name der virtuellen Maschine
3328
3429
.Parameter ResourceGroupName
35-
Specifies the name of a resource group
30+
[sr-en] Specifies the name of the resource group of the virtual machine
31+
[sr-de] Name der resource group die die virtuelle Maschine enthält
3632
3733
.Parameter Command
38-
Specifies the command that executed on the Azure virtual machine
34+
[sr-en] Specifies the command that executed on the Azure virtual machine
35+
[sr-de] Kommando das für die virtuelle Maschine ausgeführt werden soll
3936
#>
4037

4138
[CmdLetBinding()]
4239
Param(
43-
[Parameter(Mandatory = $true)]
44-
[pscredential]$AzureCredential,
4540
[Parameter(Mandatory = $true)]
4641
[string]$Name,
4742
[Parameter(Mandatory = $true)]
4843
[string]$ResourceGroupName,
4944
[ValidateSet('Stop','Start','Restart')]
50-
[string]$Command,
51-
[string]$Tenant
45+
[string]$Command
5246
)
5347

5448
Import-Module Az
5549

5650
try{
57-
# ConnectAzure -AzureCredential $AzureCredential -Tenant $Tenant
58-
5951
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
6052
'Confirm' = $false
6153
'Name' = $Name
@@ -85,5 +77,4 @@ catch{
8577
throw
8678
}
8779
finally{
88-
# DisconnectAzure -Tenant $Tenant
8980
}

0 commit comments

Comments
 (0)