Vscode powershell sdk installation problem

tech pad 0 Reputation points
2024-03-27T10:07:40.88+00:00

Hey,

Im trying to install Microsoft Graph SDK module at VSCode, but is problem i can not continue i mean carry on.. because of these warning givin me some problems. I tried to ask copilot AI , but give me a same offers as install x and y and then ect.

I followed this installation web page (https://learn.microsoft.com/en-us/powershell/microsoftgraph/installation?view=graph-powershell-1.0)

I guess the problem is on my laptop/computer devices, but I still can not understand why it does not install the Microsoft Graph those modules.

--

My vscode powershell steps, I installed PSversion 7.4.1 before, it was easy.

PS C:\Users\ZT> $psVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

First Powershell 7 set remote signed less restrictive. this works

PS C:\Users\ZT> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

PS C:\Users\ZT> get-executionPolicy -list


    Scope ExecutionPolicy
    ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser    RemoteSigned
 LocalMachine    RemoteSigned

then i tried installion those module, but still give me a same result and problems.

PS C:\Users\ZT> Install-Module Microsoft.Graph -Scope CurrentUser
WARNING: 'Microsoft.Graph' matched module 'Microsoft.Graph/2.16.0' from provider: 'PowerShellGet', repository 'PSGallery'.
Install-Package: Unable to install, multiple modules matched 'Microsoft.Graph'. Please specify an exact -Name and -RequiredVersion.

PS C:\Users\ZT> Install-Module Microsoft.Graph -Scope AllUsers   
Install-Module: Administrator rights are required to install modules in 'C:\Program Files\PowerShell\Modules'. Log on to the computer with an account that has Administrator rights, and then try again, or install 'C:\Users\ZT\Documents\PowerShell\Modules' by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated rights (Run as Administrator).

<this folder is empty>

PS C:\Users\ZT> Get-InstalledModule Microsoft.Graph
Get-Package: No match was found for the specified search criteria and module names 'Microsoft.Graph'.

PS C:\Users\ZT> Get-InstalledModule

Copilot AI gave me some offers, and I tried follow those steps like an try to install these and did not work.. so i can not carry on.

PS C:\Users\ZT> Install-Module -Name Microsoft.Graph -RequiredVersion 2.16.0 -Scope CurrentUser WARNING: 'Microsoft.Graph' matched module 'Microsoft.Graph/2.16.0' from provider: 'PowerShellGet', repository 'PSGallery'. Install-Package: Unable to install, multiple modules matched 'Microsoft.Graph'. Please specify an exact -Name and -RequiredVersion.

same issue i checked these no such a think is micosoft graph under these listavailable

PS C:\Users\ZT> get-module -listavailable

    Directory: C:\program files\powershell\7\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   7.0.0.0               CimCmdlets                          Core      {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession…}
Manifest   1.2.5                 Microsoft.PowerShell.Archive        Desk      {Compress-Archive, Expand-Archive}
Manifest   7.0.0.0               Microsoft.PowerShell.Diagnostics    Core      {Get-WinEvent, New-WinEvent, Get-Counter}
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core      {Start-Transcript, Stop-Transcript}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core      {Add-Content, Clear-Content, Get-Clipboard, Set-Clipboard…}
Binary     1.0.1                 Microsoft.PowerShell.PSResourceGet  Core,Desk {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSS…
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core      {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential…}
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core      {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Manifest   7.0.0.0               Microsoft.WSMan.Management          Core      {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuick… 
Script     1.4.8.1               PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     2.2.5                 PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script     7.0.0.0               PSDiagnostics                       Core      {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-P… 
Script     2.3.4                 PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHan… 
Binary     2.0.3                 ThreadJob                           Desk      Start-ThreadJob

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     2.0.2.182             AzureAD                             Desk
Script     3.0.0                 ExchangeOnlineManagement            Desk      {Get-ConnectionInformation, Get-EXOCasMailbox, Get-EXOMailbox, Get-EXOMailbo… 
Script     1.0.1                 Microsoft.PowerShell.Operation.Val… Desk      {Get-OperationValidation, Invoke-OperationValidation}
Script     4.9.1                 MicrosoftTeams                      Core,Desk {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams, Disconnect-Micro… 
Manifest   1.1.183.66            MSOnline                            Desk
Binary     1.0.0.1               PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     3.4.0                 Pester                              Desk      {Describe, Context, It, Should…}
Script     1.0.0.1               PowerShellGet                       Desk      {Install-Module, Find-Module, Save-Module, Update-Module…}
Script     2.0.0                 PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHan… 

    Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Manifest   1.0.0.0               AppBackgroundTask                   Core,Desk {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticL… 
Manifest   1.0.0.0               BitLocker                           Core,Desk {Unlock-BitLocker, Suspend-BitLocker, Resume-BitLocker, Remove-BitLockerKeyP… 
Script     2.0.0.0               BitsTransfer                        Core,Desk {Add-BitsFile, Complete-BitsTransfer, Get-BitsTransfer, Remove-BitsTransfer…}
Manifest   1.0                   ConfigDefenderPerformance           Core,Desk {New-MpPerformanceRecording, Get-MpPerformanceReport}
Manifest   1.0                   DefenderPerformance                 Core,Desk {New-MpPerformanceRecording, Get-MpPerformanceReport}
Manifest   1.0.3.0               DeliveryOptimization                Core,Desk {Get-DeliveryOptimizationLog, Get-DeliveryOptimizationLogAnalysis, Delete-De… 
Manifest   1.0.0.0               DirectAccessClientComponents        Core,Desk {Disable-DAManualEntryPointSelection, Enable-DAManualEntryPointSelection, Ge… 
Script     3.0                   Dism                                Core,Desk {Add-AppProvisionedSharedPackageContainer, Add-AppxProvisionedPackage, Add-W… 
Manifest   1.0.0.0               DnsClient                           Core,Desk {Resolve-DnsName, Clear-DnsClientCache, Get-DnsClient, Get-DnsClientCache…}   
Manifest   1.0.0.0               EventTracingManagement              Core,Desk {Start-EtwTraceSession, New-EtwTraceSession, Get-EtwTraceSession, Update-Etw… 
Script     2022.3.14…            Get-NetView                         Core,Desk Get-NetView
Manifest   2.1.0.0               International                       Core,Desk {Copy-UserInternationalSettingsToSystem, Get-WinDefaultInputMethodOverride, … 
Manifest   1.0.0.0               Kds                                 Core,Desk {Add-KdsRootKey, Get-KdsRootKey, Test-KdsRootKey, Set-KdsConfiguration…}      
Manifest   1.0                   LanguagePackManagement              Core,Desk {Install-Language, Uninstall-Language, Get-InstalledLanguage, Set-SystemPref… 
Script     1.0.0.0               LAPS                                Core,Desk {Find-LapsADExtendedRights, Get-LapsADPassword, Invoke-LapsPolicyProcessing,… 
Manifest   1.0.0.0               Microsoft.PowerShell.LocalAccounts  Core,Desk {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup…}  
Manifest   1.0.0                 Microsoft.Windows.Bcd.Cmdlets       Core,Desk {Copy-BcdEntry, Disable-BcdElementBootDebug, Disable-BcdElementBootEms, Disa… 
Manifest   1.0                   MMAgent                             Core,Desk {Disable-MMAgent, Enable-MMAgent, Set-MMAgent, Get-MMAgent…}
Manifest   2.0.0.0               NetAdapter                          Core,Desk {Disable-NetAdapter, Disable-NetAdapterBinding, Disable-NetAdapterChecksumOf… 
Manifest   2.0.0.0               NetConnection                       Core,Desk {Get-NetConnectionProfile, Set-NetConnectionProfile}
Manifest   1.0.0.0               NetEventPacketCapture               Core,Desk {New-NetEventSession, Remove-NetEventSession, Get-NetEventSession, Set-NetEv… 
Manifest   2.0.0.0               NetLbfo                             Core,Desk {Add-NetLbfoTeamMember, Add-NetLbfoTeamNic, Get-NetLbfoTeam, Get-NetLbfoTeam…
Manifest   1.0.0.0               NetNat                              Core,Desk {Get-NetNat, Get-NetNatExternalAddress, Get-NetNatStaticMapping, Get-NetNatS… 
Manifest   2.0.0.0               NetQos                              Core,Desk {Get-NetQosPolicy, Set-NetQosPolicy, Remove-NetQosPolicy, New-NetQosPolicy}   
Manifest   2.0.0.0               NetSecurity                         Core,Desk {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoPro… 
Manifest   1.0.0.0               NetSwitchTeam                       Core,Desk {New-NetSwitchTeam, Remove-NetSwitchTeam, Get-NetSwitchTeam, Rename-NetSwitc… 
Manifest   1.0.0.0               NetTCPIP                            Core,Desk {Get-NetIPAddress, Get-NetIPInterface, Get-NetIPv4Protocol, Get-NetIPv6Proto… 
Manifest   1.0.0.0               NetworkConnectivityStatus           Core,Desk {Get-DAConnectionStatus, Get-NCSIPolicyConfiguration, Reset-NCSIPolicyConfig… 
Manifest   1.0.0.0               NetworkSwitchManager                Core,Desk {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-Ne… 
Manifest   1.0.0.0               NetworkTransition                   Core,Desk {Add-NetIPHttpsCertBinding, Disable-NetDnsTransitionConfiguration, Disable-N… 
Manifest   1.0.0.0               PcsvDevice                          Core,Desk {Get-PcsvDevice, Start-PcsvDevice, Stop-PcsvDevice, Restart-PcsvDevice…}      
Manifest   1.0.0.0               PKI                                 Core,Desk {Add-CertificateEnrollmentPolicyServer, Export-Certificate, Export-PfxCertif… 
Manifest   1.0.0.0               PnpDevice                           Core,Desk {Get-PnpDevice, Get-PnpDeviceProperty, Enable-PnpDevice, Disable-PnpDevice}   
Manifest   1.1                   PrintManagement                     Core,Desk {Add-Printer, Add-PrinterDriver, Add-PrinterPort, Get-PrintConfiguration…}    
Binary     1.0.12                ProcessMitigations                  Core,Desk {Get-ProcessMitigation, Set-ProcessMitigation, ConvertTo-ProcessMitigationPo…
Script     3.0                   Provisioning                        Core,Desk {Install-ProvisioningPackage, Export-ProvisioningPackage, Install-TrustedPro… 
Manifest   1.0.0.0               ScheduledTasks                      Core,Desk {Get-ScheduledTask, Set-ScheduledTask, Register-ScheduledTask, Unregister-Sc… 
Manifest   2.0.0.0               SecureBoot                          Core,Desk {Confirm-SecureBootUEFI, Set-SecureBootUEFI, Get-SecureBootUEFI, Format-Secu… 
Manifest   2.0.0.0               SmbShare                            Core,Desk {Get-SmbShare, Remove-SmbShare, Set-SmbShare, Block-SmbShareAccess…}
Manifest   2.0.0.0               SmbWitness                          Core,Desk {Get-SmbWitnessClient, Move-SmbWitnessClient, gsmbw, msmbw…}
Manifest   1.0.0.1               StartLayout                         Core,Desk {Export-StartLayout, Import-StartLayout, Export-StartLayoutEdgeAssets, Get-S… 
Manifest   2.0.0.0               Storage                             Core,Desk {Add-InitiatorIdToMaskingSet, Add-PartitionAccessPath, Add-PhysicalDisk, Add… 
Manifest   2.0.0.0               TLS                                 Core,Desk {New-TlsSessionTicketKey, Enable-TlsSessionTicketKey, Disable-TlsSessionTick…
Manifest   1.0.0.0               TroubleshootingPack                 Core,Desk {Get-TroubleshootingPack, Invoke-TroubleshootingPack}
Manifest   2.0.0.0               TrustedPlatformModule               Core,Desk {Get-Tpm, Initialize-Tpm, Clear-Tpm, Unblock-Tpm…}
Manifest   2.0.0.0               VpnClient                           Core,Desk {Add-VpnConnection, Set-VpnConnection, Remove-VpnConnection, Get-VpnConnecti… 
Manifest   1.0.0.0               Wdac                                Core,Desk {Get-OdbcDriver, Set-OdbcDriver, Get-OdbcDsn, Add-OdbcDsn…}
Manifest   2.0.0.0               Whea                                Core,Desk {Get-WheaMemoryPolicy, Set-WheaMemoryPolicy}
Manifest   1.0.0.0               WindowsDeveloperLicense             Core,Desk {Get-WindowsDeveloperLicense, Unregister-WindowsDeveloperLicense, Show-Windo… 
Script     1.0                   WindowsErrorReporting               Core,Desk {Enable-WindowsErrorReporting, Disable-WindowsErrorReporting, Get-WindowsErr… 
Manifest   1.0.0.0               WindowsSearch                       Core,Desk {Get-WindowsSearchSetting, Set-WindowsSearchSetting}
Manifest   1.0.0.0               WindowsUpdate                       Core,Desk Get-WindowsUpdateLog

PS C:\Users\ZT> get-module -listavailable | Where-Object {$_.Name -like '*Microsoft.Graph*'}
PS C:\Users\ZT> 

QUestion; is there another way install the microsoft graph? or replace current my version and reinstall again? Or remove uninstall the former what i have done?

If there got good solution, please i would be appreciate it, so thank you.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
{count} votes