Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function Get-AzDevCenterUserEnvironmentAction {
[Parameter(ParameterSetName = 'Get', Mandatory)]
[Parameter(ParameterSetName = 'GetByDevCenter', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DevCenterdata.Category('Path')]
[Alias('ActionName')]
[System.String]
# The name of an action that will take place on an Environment.
${Name},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ https://learn.microsoft.com/powershell/module/az.devcenter/get-azdevcenterusersc
#>
function Get-AzDevCenterUserSchedule {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DevCenterdata.Models.Api20231001Preview.ISchedule])]
[CmdletBinding(DefaultParameterSetName = 'Get', PositionalBinding = $false)]
[CmdletBinding(PositionalBinding = $false)]
param(
[Parameter(ParameterSetName ='Get', Mandatory)]
[Parameter(ParameterSetName ='GetViaIdentity', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function Invoke-AzDevCenterUserDelayEnvironmentAction {
[Parameter(ParameterSetName = 'Delay', Mandatory)]
[Parameter(ParameterSetName = 'DelayByDevCenter', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DevCenterdata.Category('Path')]
[Alias('ActionName')]
[System.String]
# The name of an action that will take place on an Environment.
${Name},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ The name of an action that will take place on an Environment.
```yaml
Type: System.String
Parameter Sets: Get, GetByDevCenter
Aliases:
Aliases: ActionName

Required: True
Position: Named
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ Gets a schedule.

## SYNTAX

### Get (Default)
### List (Default)
```
Get-AzDevCenterUserSchedule -Endpoint <String> -ProjectName <String> [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### Get
```
Get-AzDevCenterUserSchedule -Endpoint <String> -PoolName <String> -ProjectName <String> -ScheduleName <String>
[-DefaultProfile <PSObject>] [<CommonParameters>]
Expand All @@ -36,12 +42,6 @@ Get-AzDevCenterUserSchedule -DevCenterName <String> -InputObject <IDevCenterdata
[-DefaultProfile <PSObject>] [<CommonParameters>]
```

### List
```
Get-AzDevCenterUserSchedule -Endpoint <String> -ProjectName <String> [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### List1
```
Get-AzDevCenterUserSchedule -Endpoint <String> -PoolName <String> -ProjectName <String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The name of an action that will take place on an Environment.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Aliases: ActionName

Required: True
Position: Named
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDevCenterUserEnvironmentLog'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDevCenterUserEnvironmentLog.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
if (($null -eq $TestName) -or ($TestName -contains 'Get-AzDevCenterUserEnvironmentLog')) {
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDevCenterUserEnvironmentLog.Recording.json'
$currentPath = $PSScriptRoot
while (-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}

Describe 'Get-AzDevCenterUserEnvironmentLog' {
It 'Get' {
Get-AzDevCenterUserEnvironmentLog -Endpoint $env.endpoint10 -EnvironmentName $env.envName10 -ProjectName $env.projectName10 -OperationId "4d48a4d5-7edc-437d-9bfa-30e9b4328f68" -OutFile "C:\Users\amlim\repos\testing.txt" }
if ($Record -or $Live) {
Get-AzDevCenterUserEnvironmentLog -Endpoint $env.endpoint10 -EnvironmentName $env.envName10 -ProjectName $env.projectName10 -OperationId "4d48a4d5-7edc-437d-9bfa-30e9b4328f68" -OutFile "C:\Users\amlim\repos\testing.txt"
}
}

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"Invoke-AzDevCenterUserDelayEnvironmentAction+[NoContext]+Delay+$GET+https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh/actions/Delete?api-version=2023-10-01-preview+1": {
"Invoke-AzDevCenterUserDelayEnvironmentAction+[NoContext]+Delay+$GET+https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh2/actions/Delete?api-version=2023-10-01-preview+1": {
"Request": {
"Method": "GET",
"RequestUri": "https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh/actions/Delete?api-version=2023-10-01-preview",
"RequestUri": "https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh2/actions/Delete?api-version=2023-10-01-preview",
"Content": null,
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "1" ],
"x-ms-client-request-id": [ "bd7bab74-895f-4570-82c8-eb2a30d63c73" ],
"x-ms-client-request-id": [ "0189a73e-9dbf-4948-87d7-3bdf78a7967f" ],
"CommandName": [ "Az.DevCenterdata.internal\\Get-AzDevCenterUserEnvironmentAction" ],
"FullCommandName": [ "Get-AzDevCenterUserEnvironmentAction_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
"User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.2.16", "Az.DevCenterdata/0.1.0" ],
"User-Agent": [ "AzurePowershell/v9.4.0", "PSVersion/v7.2.17", "Az.DevCenterdata/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
Expand All @@ -20,39 +20,39 @@
"Response": {
"StatusCode": 200,
"Headers": {
"Date": [ "Mon, 13 Nov 2023 05:36:13 GMT" ],
"Date": [ "Tue, 28 Nov 2023 07:19:09 GMT" ],
"Connection": [ "keep-alive" ],
"x-ms-correlation-request-id": [ "5832591f-dde4-4600-8542-bcfe5edde5a2" ],
"x-ms-client-request-id": [ "bd7bab74-895f-4570-82c8-eb2a30d63c73" ],
"x-ms-correlation-request-id": [ "bdb0461f-4e1e-40f9-8bb3-c449ce0468c0" ],
"x-ms-client-request-id": [ "0189a73e-9dbf-4948-87d7-3bdf78a7967f" ],
"X-Rate-Limit-Limit": [ "1m" ],
"X-Rate-Limit-Remaining": [ "299" ],
"X-Rate-Limit-Reset": [ "2023-11-13T05:37:13.4766872Z" ],
"X-Rate-Limit-Remaining": [ "298" ],
"X-Rate-Limit-Reset": [ "2023-11-28T07:19:57.9227999Z" ],
"Strict-Transport-Security": [ "max-age=15724800; includeSubDomains" ],
"Access-Control-Allow-Origin": [ "*" ],
"Access-Control-Max-Age": [ "86400" ],
"Access-Control-Expose-Headers": [ "Location,Operation-Location,x-ms-correlation-request-id,x-ms-client-request-id" ]
},
"ContentHeaders": {
"Content-Type": [ "application/json; charset=utf-8" ],
"Content-Length": [ "459" ]
"Content-Length": [ "460" ]
},
"Content": "{\n \"name\": \"Delete\",\n \"uri\": \"https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshproj3stxlh/users/c3c951b7-d307-4c40-9495-70bd562d98d5/environments/amlim-pwsh/environmentactions/Delete\",\n \"actionType\": \"Delete\",\n \"next\": {\n \"scheduledTime\": \"2023-12-01T07:35:00.000000Z\"\n },\n \"lastModifiedBy\": \"c3c951b7-d307-4c40-9495-70bd562d98d5\",\n \"lastModifiedAt\": \"2023-11-13T04:39:13.5195132+00:00\"\n}",
"Content": "{\n \"name\": \"Delete\",\n \"uri\": \"https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshproj3stxlh/users/c3c951b7-d307-4c40-9495-70bd562d98d5/environments/amlim-pwsh2/environmentactions/Delete\",\n \"actionType\": \"Delete\",\n \"next\": {\n \"scheduledTime\": \"2023-12-02T11:45:00.000000Z\"\n },\n \"lastModifiedBy\": \"c3c951b7-d307-4c40-9495-70bd562d98d5\",\n \"lastModifiedAt\": \"2023-11-28T07:18:57.9471829+00:00\"\n}",
"isContentBase64": false
}
},
"Invoke-AzDevCenterUserDelayEnvironmentAction+[NoContext]+Delay+$POST+https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh/actions/Delete:delay?api-version=2023-10-01-preview&until=2023-11-23T00:05:00.0000000Z+2": {
"Invoke-AzDevCenterUserDelayEnvironmentAction+[NoContext]+Delay+$POST+https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh2/actions/Delete:delay?api-version=2023-10-01-preview\u0026until=2023-12-02T11:50:00.0000000Z+2": {
"Request": {
"Method": "POST",
"RequestUri": "https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh/actions/Delete:delay?api-version=2023-10-01-preview&until=2023-12-01T07:40:00.0000000Z",
"RequestUri": "https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshProj3stxlh/users/me/environments/amlim-pwsh2/actions/Delete:delay?api-version=2023-10-01-preview\u0026until=2023-12-02T11:50:00.0000000Z",
"Content": null,
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "3" ],
"x-ms-client-request-id": [ "10d1ed26-c21f-42ea-8d89-c38bbd3af6b1" ],
"x-ms-client-request-id": [ "6bdeeb9d-ef58-45b9-b5b8-6bb601f1338a" ],
"CommandName": [ "Az.DevCenterdata.internal\\Invoke-AzDevCenterUserDelayEnvironmentAction" ],
"FullCommandName": [ "Invoke-AzDevCenterUserDelayEnvironmentAction_Delay" ],
"ParameterSetName": [ "__AllParameterSets" ],
"User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.2.16", "Az.DevCenterdata/0.1.0" ],
"User-Agent": [ "AzurePowershell/v9.4.0", "PSVersion/v7.2.17", "Az.DevCenterdata/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
Expand All @@ -61,23 +61,23 @@
"Response": {
"StatusCode": 200,
"Headers": {
"Date": [ "Mon, 13 Nov 2023 05:36:14 GMT" ],
"Date": [ "Tue, 28 Nov 2023 07:19:10 GMT" ],
"Connection": [ "keep-alive" ],
"x-ms-correlation-request-id": [ "0a8c62db-1627-4802-83a8-9ae79af7b3f8" ],
"x-ms-client-request-id": [ "10d1ed26-c21f-42ea-8d89-c38bbd3af6b1" ],
"x-ms-correlation-request-id": [ "632c3aad-b324-4494-b955-1bedb7fdfb01" ],
"x-ms-client-request-id": [ "6bdeeb9d-ef58-45b9-b5b8-6bb601f1338a" ],
"X-Rate-Limit-Limit": [ "1m" ],
"X-Rate-Limit-Remaining": [ "299" ],
"X-Rate-Limit-Reset": [ "2023-11-13T05:37:14.5171000Z" ],
"X-Rate-Limit-Reset": [ "2023-11-28T07:20:09.8305280Z" ],
"Strict-Transport-Security": [ "max-age=15724800; includeSubDomains" ],
"Access-Control-Allow-Origin": [ "*" ],
"Access-Control-Max-Age": [ "86400" ],
"Access-Control-Expose-Headers": [ "Location,Operation-Location,x-ms-correlation-request-id,x-ms-client-request-id" ]
},
"ContentHeaders": {
"Content-Type": [ "application/json; charset=utf-8" ],
"Content-Length": [ "459" ]
"Content-Length": [ "460" ]
},
"Content": "{\n \"name\": \"Delete\",\n \"uri\": \"https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshproj3stxlh/users/c3c951b7-d307-4c40-9495-70bd562d98d5/environments/amlim-pwsh/environmentactions/Delete\",\n \"actionType\": \"Delete\",\n \"next\": {\n \"scheduledTime\": \"2023-12-01T07:40:00.000000Z\"\n },\n \"lastModifiedBy\": \"c3c951b7-d307-4c40-9495-70bd562d98d5\",\n \"lastModifiedAt\": \"2023-11-13T05:36:14.7602565+00:00\"\n}",
"Content": "{\n \"name\": \"Delete\",\n \"uri\": \"https://003b06c3-d471-4452-9686-9e7f3ca85f0a-pwshtestdevcenter.centraluseuap.devcenter.azure.com/projects/pwshproj3stxlh/users/c3c951b7-d307-4c40-9495-70bd562d98d5/environments/amlim-pwsh2/environmentactions/Delete\",\n \"actionType\": \"Delete\",\n \"next\": {\n \"scheduledTime\": \"2023-12-02T11:50:00.000000Z\"\n },\n \"lastModifiedBy\": \"c3c951b7-d307-4c40-9495-70bd562d98d5\",\n \"lastModifiedAt\": \"2023-11-28T07:19:10.1235094+00:00\"\n}",
"isContentBase64": false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDevCenterUserDelayEn

Describe 'Invoke-AzDevCenterUserDelayEnvironmentAction' {
It 'Delay' {
$action = Get-AzDevCenterUserEnvironmentAction -Endpoint $env.endpoint10 -EnvironmentName $env.envName10 -ProjectName $env.projectName10 -Name "Delete"
$delayTime = New-TimeSpan -Minutes 5
$newScheduledTime = $action.NextScheduledTime + $delayTime
$delayAction = Invoke-AzDevCenterUserDelayEnvironmentAction -Endpoint $env.endpoint10 -EnvironmentName $env.envName10 -ProjectName $env.projectName10 -Name "Delete" -DelayTime "00:05"
$delayAction.NextScheduledTime | Should -Be $newScheduledTime
if ($Record -or $Live) {
$action = Get-AzDevCenterUserEnvironmentAction -Endpoint $env.endpoint10 -EnvironmentName $env.envName11 -ProjectName $env.projectName10 -Name "Delete"
$delayTime = New-TimeSpan -Minutes 5
$newScheduledTime = $action.NextScheduledTime + $delayTime
$delayAction = Invoke-AzDevCenterUserDelayEnvironmentAction -Endpoint $env.endpoint10 -EnvironmentName $env.envName11 -ProjectName $env.projectName10 -Name "Delete" -DelayTime "00:05"
$delayAction.NextScheduledTime | Should -Be $newScheduledTime
}
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Module","ClassName","Target","Severity","ProblemId","Description","Remediation"
"Az.DevCenter","Get-AzDevCenterUserSchedule","Get-AzDevCenterUserSchedule","0","1060","The parameter set 'Get' for cmdlet 'Get-AzDevCenterUserSchedule' is no longer the default parameter set.","Change the default parameter for cmdlet 'Get-AzDevCenterUserSchedule' back to 'Get'."