Skip to content

Commit

Permalink
Rename module (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenitoInc committed Nov 21, 2024
1 parent 119292c commit 0fff351
Show file tree
Hide file tree
Showing 1,485 changed files with 4,497 additions and 4,474 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/1es-entra-powershell-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extends:
- template: .azure-pipelines/common-templates/esrp/codesign-nuget-migrate.yml@self
parameters:
FolderPath: "$(Build.ArtifactStagingDirectory)"
Pattern: "Microsoft.Graph.Entra.*.nupkg"
Pattern: "Microsoft.Entra.*.nupkg"
- task: 1ES.PublishBuildArtifacts@1
displayName: Publish Module Artifacts
inputs:
Expand All @@ -68,7 +68,7 @@ extends:
displayName: Publish NuGet to preview feed
inputs:
useDotNetTask: false
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.Entra.*.nupkg
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Entra.*.nupkg
packageParentPath: '$(Build.ArtifactStagingDirectory)'
publishVstsFeed: $(PROJECT_NAME)/$(PREVIEW_FEED_NAME)
nuGetFeedType: internal
Expand Down
5 changes: 5 additions & 0 deletions .azure-pipelines/1es-entra-powershell-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ extends:
displayName: Publish Nuget package
inputs:
useDotNetTask: false
<<<<<<< HEAD
packagesToPush: '$(System.ArtifactsDirectory)/drop/Microsoft.Graph.Entra*.nupkg'
packageParentPath: '$(System.ArtifactsDirectory)'
=======
packagesToPush: '$(Pipeline.Workspace)/drop/Microsoft.Entra*.nupkg'
packageParentPath: '$(Pipeline.Workspace)/drop'
>>>>>>> e6ba625db (Rename module (#1223))
nuGetFeedType: external
publishFeedCredentials: EntraPowerShell_PSGallery
4 changes: 2 additions & 2 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- template: ./common-templates/esrp/codesign-nuget.yml
parameters:
FolderPath: "$(Build.ArtifactStagingDirectory)"
Pattern: "Microsoft.Graph.Entra.*.nupkg"
Pattern: "Microsoft.Entra.*.nupkg"

- task: PublishBuildArtifacts@1
displayName: Publish Module Artifacts
Expand All @@ -54,7 +54,7 @@ jobs:
displayName: Publish NuGet to preview feed
inputs:
command: push
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.Entra.*.nupkg
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Entra.*.nupkg
publishVstsFeed: $(PROJECT_NAME)/$(PREVIEW_FEED_NAME)
allowPackageConflicts: true

Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/entra-powershell-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stages:
inputs:
targetType: inline
script: |
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path $(Build.ArtifactStagingDirectory)/modules/Microsoft.Graph.Entra -Verbose
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path $(Build.ArtifactStagingDirectory)/modules/Microsoft.Graph.Entra.Beta -Verbose
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path $(Build.ArtifactStagingDirectory)/modules/Microsoft.Entra -Verbose
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path $(Build.ArtifactStagingDirectory)/modules/Microsoft.Entra.Beta -Verbose
pwsh: false
dependsOn: Release_Approval
8 changes: 4 additions & 4 deletions .azure-pipelines/generation-templates/generate_adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ steps:
targetType: "inline"
pwsh: true
script: |
$ModulePsd1 = "bin/Microsoft.Graph.Entra.psd1"
$ModulePsm1 = "bin/Microsoft.Graph.Entra.psm1"
$ModulePsd1 = "bin/Microsoft.Entra.psd1"
$ModulePsm1 = "bin/Microsoft.Entra.psm1"
($ModulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
($ModulePsm1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
- task: powershell@2
Expand Down Expand Up @@ -143,8 +143,8 @@ steps:
targetType: "inline"
pwsh: true
script: |
$ModulePsd1 = "bin/Microsoft.Graph.Entra.Beta.psd1"
$ModulePsm1 = "bin/Microsoft.Graph.Entra.Beta.psm1"
$ModulePsd1 = "bin/Microsoft.Entra.Beta.psd1"
$ModulePsm1 = "bin/Microsoft.Entra.Beta.psm1"
($ModulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
($ModulePsm1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
- task: powershell@2
Expand Down
8 changes: 4 additions & 4 deletions build/Publish-LocalCompatModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else{
$fullModuleNames += $modName
}

if($fullModuleName -like 'Microsoft.Graph.Entra.Beta*'){
if($fullModuleName -like 'Microsoft.Entra.Beta*'){
$moduleName = 'EntraBeta'
}
else{
Expand All @@ -44,7 +44,7 @@ foreach ($destinationModuleName in $content.destinationModuleName){
}

foreach($module in $fullModuleNames){
if(($module -eq 'Microsoft.Graph.Entra') -or ($module -eq 'Microsoft.Graph.Entra.Beta')){
if(($module -eq 'Microsoft.Entra') -or ($module -eq 'Microsoft.Entra.Beta')){
continue
}
$modulePath = Join-Path (Get-ModuleBasePath) (Get-ConfigValue -Name ModuleOutputSubdirectoryName)
Expand All @@ -60,10 +60,10 @@ foreach($module in $fullModuleNames){
}

if($moduleName -eq 'Entra'){
$module = 'Microsoft.Graph.Entra'
$module = 'Microsoft.Entra'
}
else{
$module = 'Microsoft.Graph.Entra.Beta'
$module = 'Microsoft.Entra.Beta'
}

$modulePath = Join-Path (Get-ModuleBasePath) (Get-ConfigValue -Name ModuleOutputSubdirectoryName)
Expand Down
4 changes: 2 additions & 2 deletions build/Split-Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ function Split-Tests {
$TestSourceDirectory = "../test_legacy/module/Entra"
$MappingFilePath = '../module/Entra/config/moduleMapping.json'
$OutputDirectory = '../test/Entra'
$modulePrefix = 'Microsoft.Graph.Entra'
$modulePrefix = 'Microsoft.Entra'
}
'EntraBeta' {
$TestSourceDirectory = "../test_legacy/module/EntraBeta"
$MappingFilePath = "../module/EntraBeta/config/moduleMapping.json"
$OutputDirectory = "../test/EntraBeta"
$modulePrefix = 'Microsoft.Graph.Entra.Beta'
$modulePrefix = 'Microsoft.Entra.Beta'
}
default {
Log-Message -Message "Invalid Source specified. Use 'Entra' or 'EntraBeta'." -Level 'ERROR'
Expand Down
6 changes: 3 additions & 3 deletions build/VNext-Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ The generated modules are in the output folder `./bin`

SubModule in this case is the name of the specific sub-module you want to use. They are: `Authentication,Users,DirectoryManagement, Groups, Applications,Governance,SignIns and Reports`

In order to import it, you need to run `Import-Module .\bin\Microsoft.Graph.Entra.<SubModule>psd1 -Force`
In order to import it, you need to run `Import-Module .\bin\Microsoft.Entra.<SubModule>psd1 -Force`

Alternatively, import the root module(that encompases and includes all the sub-modules and their help and dependencies) `Import-Module .\bin\Microsoft.Graph.Entra.psd1 -Force`
Alternatively, import the root module(that encompases and includes all the sub-modules and their help and dependencies) `Import-Module .\bin\Microsoft.Entra.psd1 -Force`

## Usage

Import the module and test the generated commands.

```powershell
Import-Module .\bin\Microsoft.Graph.Entra.<SubModule>.psd1 -Force
Import-Module .\bin\Microsoft.Entra.<SubModule>.psd1 -Force
Connect-MgGraph -Scopes "User.Read.All"
Get-EntraUser -Top 10
```
Expand Down
2 changes: 1 addition & 1 deletion build/ValidateAuthenticodeSignature.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ foreach($moduleName in $moduleNames){
$modulePsd1 = $modulePath + ".psd1"
($modulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"

if(($moduleName -eq 'Microsoft.Graph.Entra') -or ($moduleName -eq 'Microsoft.Graph.Entra.Beta')){
if(($moduleName -eq 'Microsoft.Entra') -or ($moduleName -eq 'Microsoft.Entra.Beta')){
continue
}
$modulePsm1 = $modulePath + ".psm1"
Expand Down
6 changes: 3 additions & 3 deletions build/common-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function Get-ModuleBasePath {
}

function Get-ModuleVersion {
# Added -ErrorAction SilentlyContinue due to validation failure on Microsoft.Graph.Entra RequiredModules
# The RequiredModules are the Microsoft.Graph.Entra.* sub-modules
# Added -ErrorAction SilentlyContinue due to validation failure on Microsoft.Entra RequiredModules
# The RequiredModules are the Microsoft.Entra.* sub-modules
(Get-ModuleManifestFile).FullName | Test-ModuleManifest -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Version
}

Expand Down Expand Up @@ -167,7 +167,7 @@ function Create-ModuleFolder {
$destinationFileList = @()
$moduleFiles = @()

if(($module -eq 'Microsoft.Graph.Entra') -or ($module -eq 'Microsoft.Graph.Entra.Beta')){
if(($module -eq 'Microsoft.Entra') -or ($module -eq 'Microsoft.Entra.Beta')){
$moduleFiles += Get-ModuleFiles | Where { $_ -like "*$module.psd1" }
$moduleFiles += Get-ModuleFiles | Where { $_ -like "*$module.psm1" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ ms.author: eunicewaweru
manager: CelesteDG
author: msewaweru

external help file: Microsoft.Graph.Entra.Beta-Help.xml
Module Name: Microsoft.Graph.Entra.Beta
online version: https://learn.microsoft.com/powershell/module/Microsoft.Graph.Entra.Beta/Get-EntraBetaUser
external help file: Microsoft.Entra.Beta-Help.xml
Module Name: Microsoft.Entra.Beta
online version: https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Get-EntraBetaUser

schema: 2.0.0
---
Expand All @@ -20,7 +20,7 @@ schema: 2.0.0

Reference

Module: **Microsoft.Graph.Entra.Beta**
Module: **Microsoft.Entra.Beta**

## Synopsis

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ ms.author: eunicewaweru
manager: CelesteDG
author: msewaweru

external help file: Microsoft.Graph.Entra-Help.xml
Module Name: Microsoft.Graph.Entra
online version: https://learn.microsoft.com/powershell/module/Microsoft.Graph.Entra/Get-EntraUser
external help file: Microsoft.Entra-Help.xml
Module Name: Microsoft.Entra
online version: https://learn.microsoft.com/powershell/module/Microsoft.Entra/Get-EntraUser

schema: 2.0.0
---
Expand All @@ -20,7 +20,7 @@ schema: 2.0.0

Reference

Module: **Microsoft.Graph.Entra**
Module: **Microsoft.Entra**

## Synopsis

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ manager: CelesteDG
author: msewaweru
ms.reviewer: stevemutungi

external help file: Microsoft.Graph.Entra-Help.xml //use `Microsoft.Graph.Entra.Beta-Help.xml` for beta commands
Module Name: Microsoft.Graph.Entra //use `Microsoft.Graph.Entra.Beta` for beta commands
online version: https://learn.microsoft.com/powershell/module/Microsoft.Graph.Entra/<Command-Name> //use `https://learn.microsoft.com/powershell/module/Microsoft.Graph.Entra.Beta/<Command-Name>` for beta commands
external help file: Microsoft.Entra-Help.xml //use `Microsoft.Entra.Beta-Help.xml` for beta commands
Module Name: Microsoft.Entra //use `Microsoft.Entra.Beta` for beta commands
online version: https://learn.microsoft.com/powershell/module/Microsoft.Entra/<Command-Name> //use `https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/<Command-Name>` for beta commands

schema: 2.0.0
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function New-EntraCustomHeaders {
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Graph.Entra.Groups | Select-Object version).Version.ToString()
$entraVersion = (Get-Module Microsoft.Entra.Applications | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
function New-EntraCustomHeaders {
<#
.SYNOPSIS
Creates a custom header for use in telemetry.
.DESCRIPTION
The custom header created is a User-Agent with header value "<PowerShell version> EntraPowershell/<EntraPowershell version> <Entra PowerShell command>"
.PARAMETER Command
The command that is being executed.
.EXAMPLE
New-EntraCustomHeaders -Command Get-EntraUser
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$Command
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Entra.Authentication | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue

$customHeaders
}# ------------------------------------------------------------------------------

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function New-EntraCustomHeaders {
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Graph.Entra.Applications | Select-Object version).Version.ToString()
$entraVersion = (Get-Module Microsoft.Entra.DirectoryManagement | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function New-EntraCustomHeaders {
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Graph.Entra.Users | Select-Object version).Version.ToString()
$entraVersion = (Get-Module Microsoft.Entra.Governance | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function New-EntraCustomHeaders {
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Graph.Entra.SignIns | Select-Object version).Version.ToString()
$entraVersion = (Get-Module Microsoft.Entra.Groups | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function New-EntraCustomHeaders {
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Graph.Entra.Reports | Select-Object version).Version.ToString()
$entraVersion = (Get-Module Microsoft.Entra.Reports | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue
Expand Down
31 changes: 31 additions & 0 deletions module/Entra/Microsoft.Entra/SignIns/New-EntraCustomHeaders.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
function New-EntraCustomHeaders {
<#
.SYNOPSIS
Creates a custom header for use in telemetry.
.DESCRIPTION
The custom header created is a User-Agent with header value "<PowerShell version> EntraPowershell/<EntraPowershell version> <Entra PowerShell command>"
.PARAMETER Command
The command that is being executed.
.EXAMPLE
New-EntraCustomHeaders -Command Get-EntraUser
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$Command
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Entra.SignIns | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue

$customHeaders
}# ------------------------------------------------------------------------------

31 changes: 31 additions & 0 deletions module/Entra/Microsoft.Entra/Users/New-EntraCustomHeaders.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
function New-EntraCustomHeaders {
<#
.SYNOPSIS
Creates a custom header for use in telemetry.
.DESCRIPTION
The custom header created is a User-Agent with header value "<PowerShell version> EntraPowershell/<EntraPowershell version> <Entra PowerShell command>"
.PARAMETER Command
The command that is being executed.
.EXAMPLE
New-EntraCustomHeaders -Command Get-EntraUser
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$Command
)

$psVersion = $global:PSVersionTable.PSVersion
$entraVersion = (Get-Module Microsoft.Entra.Users | Select-Object version).Version.ToString()
$userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion $Command"
$customHeaders = New-Object 'system.collections.generic.dictionary[string,string]'
$customHeaders["User-Agent"] = $userAgentHeaderValue

$customHeaders
}# ------------------------------------------------------------------------------

Loading

0 comments on commit 0fff351

Please sign in to comment.