nikolar97
I think you need to put
"Install-Module Microsoft.Graph -AllowPrerelease -AllowClobber -Force" AFTER defining parameters and not before. 🙂
Example:
<#
.COPYRIGHT
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
See LICENSE in the project root for license information.
#>
####################################################
param(
[Parameter(Mandatory=$True)]
[string]$appId_DEV,
[Parameter(Mandatory=$True)]
[string]$appSecret_DEV,
[Parameter(Mandatory=$True)]
[string]$tenantId_DEV
)
Install-Module Microsoft.Graph -AllowPrerelease -AllowClobber -Force
# Add environment variables to be used by Connect-MgGraph.
$Env:AZURE_CLIENT_ID = $appId_DEV #application id of the client app
$Env:AZURE_TENANT_ID = $tenantId_DEV #Id of your tenant
$Env:AZURE_CLIENT_SECRET = $appSecret_DEV #secret of the client app
# Tell Connect-MgGraph to use your environment variables.
Connect-MgGraph -EnvironmentVariable