-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2661 from microsoftgraph/2645-set-mguserphotocont…
…ent-not-working-in-powershell-5 Makes ``Set-MgUserPhotoContent`` compatible with both PS Core and PS Desktop
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
Submodule autorest.powershell
updated
2 files
+2 −4 | powershell/llcsharp/operation/method.ts | |
+54 −0 | powershell/resources/runtime/csharp/json/Helpers/MimeTypesHelper.cs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"Set-MgUserPhotoContent+[NoContext]+ShouldUpdatePhoto+$PUT+https://graph.microsoft.com/v1.0/users/contoso@micorosoft.com/photo/$value": { | ||
"Request": { | ||
"Method": "PUT", | ||
"Body": "binary data", | ||
"Headers": { | ||
"Content-Type": "image/jpg" | ||
} | ||
}, | ||
"Response": { | ||
"StatusCode": 200, | ||
"Headers": { | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000" | ||
], | ||
"request-id": [ | ||
"ceec1bb3-bfe4-4f4c-9bba-b47f18ab1372" | ||
], | ||
"client-request-id": [ | ||
"7f583ee0-9357-4c32-84df-25f1d7f05636" | ||
], | ||
"x-ms-ags-diagnostic": [ | ||
"{\"ServerInfo\":{\"DataCenter\":\"West US 2\",\"Slice\":\"E\",\"Ring\":\"1\",\"ScaleUnit\":\"001\",\"RoleInstance\":\"MW2PEPF0000749D\"}}" | ||
], | ||
"Date": [ | ||
"Thu, 04 Jun 2024 16:33:12 GMT" | ||
] | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if (($null -eq $TestName) -or ($TestName -contains 'Set-MgUserPhotoContent')) { | ||
$TestMode = 'playback' | ||
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' | ||
if (-Not (Test-Path -Path $loadEnvPath)) { | ||
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' | ||
} | ||
. ($loadEnvPath) | ||
$TestRecordingFile = Join-Path $PSScriptRoot 'Set-MgUserPhotoContent.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 'Set-MgUserPhotoContent' { | ||
BeforeAll { | ||
$Mock.PushDescription('Set-MgUserPhotoContent') | ||
} | ||
Context 'Update' { | ||
It 'ShouldUpdatePhoto' { | ||
$Mock.PushScenario('ShouldUpdatePhoto') | ||
{ Set-MgUserPhotoContent -UserId contoso@microsoft.com -InFile "src\Users\v1.0\test\Langchain.jpg" } | Should -Not -Throw | ||
} | ||
} | ||
} |