Powershell: لا يمكن إلغاء تثبيت / إزالة وحدة AzureRM النمطية من PowerShell على نظام التشغيل Mac OS

تم إنشاؤها على ٢٧ أكتوبر ٢٠١٧  ·  3تعليقات  ·  مصدر: PowerShell/PowerShell

خطوات التكاثر

أولاً ، أقوم بتشغيل الأمر:

Install-Module` AzureRM -AllowClobber -Scope CurrentUser   

لا أعلم أنني لن أتمكن من استخدامه على نظام التشغيل Mac OS Sierr 10.12.6.
عندما وجدت المشكلة رقم 4090 ، قمت بتشغيل الأمر:

Install-Module` AzureRM.netcore -AllowClobber -Scope CurrentUser 

بعد ذلك ، ما زلت لا أستطيع الركض

Login-AzureRmAccount 

لأنه لا يزال هناك خطأ:
Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.profile', but the module could not be loaded. For more information, run 'Import-Module AzureRM.profile'.

لقد حاولت إلغاء تثبيت الوحدة النمطية AzureRM و AzureRM.netcore باستخدام الأمر التالي:

Uninstall-Module AzureRM -AllVersions -Force 
Uninstall-Module AzureRM.netcore -AllVersions -Force 

ثم حاولت تثبيت AzureRM.netcore مرة أخرى

Install-Module` AzureRM.netcore -AllowClobber -Scope CurrentUser 

وتشغيل الأمر

Login-AzureRmAccount 

ولكن حصل بالضبط نفس الخطأ.
Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.profile', but the module could not be loaded. For more information, run 'Import-Module AzureRM.profile'.
عندما أركض

Import-Module AzureRM.profile   

حصل خطأ:
Import-Module : Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.

لقد حاولت إلغاء تثبيت الوحدة النمطية AzureRM و AzureRM.netcore مرة أخرى باستخدام الأمر التالي:

Uninstall-Module AzureRM -AllVersions -Force 
Uninstall-Module AzureRM.netcore -AllVersions -Force 

وأدرجت الوحدات النمطية ذات الصلة بـ Azure على أمل أن تختفي ، ولكن يبدو أنه لم تتم إزالتها:

Get-Module -ListAvailable |Where-Object {$_.Name -like 'AzureRM*'}                                                                                                                         


    Directory: /Users/basia/.local/share/powershell/Modules


ModuleType Version    Name                                ExportedCommands                                                                                                                                 
---------- -------    ----                                ----------------                                                                                                                                 
Script     0.4.7      AzureRM.AnalysisServices            {Resume-AzureRmAnalysisServicesServer, Suspend-AzureRmAnalysisServicesServer, Get-AzureRmAnalysisServicesServer, Remove-AzureRmAnalysisService...
Script     4.4.1      AzureRM.ApiManagement               {Add-AzureRmApiManagementRegion, Get-AzureRmApiManagementSsoToken, New-AzureRmApiManagementHostnameConfiguration, New-AzureRmApiManagementRegi...
Script     3.4.1      AzureRM.Automation                  {Get-AzureRMAutomationHybridWorkerGroup, Get-AzureRmAutomationJobOutputRecord, Import-AzureRmAutomationDscNodeConfiguration, Export-AzureRmAut...
Script     3.4.1      AzureRM.Backup                      {Backup-AzureRmBackupItem, Enable-AzureRmBackupContainerReregistration, Get-AzureRmBackupContainer, Register-AzureRmBackupContainer...}          
Script     3.4.1      AzureRM.Batch                       {Remove-AzureRmBatchAccount, Get-AzureRmBatchAccount, Get-AzureRmBatchAccountKeys, New-AzureRmBatchAccount...}                                   
Script     0.13.7     AzureRM.Billing                     {Get-AzureRmBillingInvoice, Get-AzureRmBillingPeriod}                                                                                            
Script     3.4.1      AzureRM.Cdn                         {Get-AzureRmCdnProfile, Get-AzureRmCdnProfileSsoUrl, New-AzureRmCdnProfile, Remove-AzureRmCdnProfile...}                                         
Script     0.8.7      AzureRM.CognitiveServices           {Get-AzureRmCognitiveServicesAccount, Get-AzureRmCognitiveServicesAccountKey, Get-AzureRmCognitiveServicesAccountSkus, New-AzureRmCognitiveSer...
Script     3.4.1      AzureRM.Compute                     {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet, New-AzureRmAvailabilitySet, Update-AzureRmAvailabilitySet...}                        
Manifest   0.9.1      AzureRM.Compute.Netcore             {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet, New-AzureRmAvailabilitySet, Update-AzureRmAvailabilitySet...}                        
Script     0.2.7      AzureRM.Consumption                 Get-AzureRmConsumptionUsageDetail                                                                                                                
Script     0.0.2      AzureRM.ContainerInstance           {New-AzureRmContainerGroup, Get-AzureRmContainerGroup, Remove-AzureRmContainerGroup, Get-AzureRmContainerInstanceLog}                            
Script     0.2.7      AzureRM.ContainerRegistry           {New-AzureRmContainerRegistry, Get-AzureRmContainerRegistry, Update-AzureRmContainerRegistry, Remove-AzureRmContainerRegistry...}                
Script     3.4.1      AzureRM.DataFactories               {Remove-AzureRmDataFactory, Get-AzureRmDataFactoryRun, Get-AzureRmDataFactorySlice, Save-AzureRmDataFactoryLog...}                               
Script     0.2.1      AzureRM.DataFactoryV2               {Set-AzureRmDataFactoryV2, Get-AzureRmDataFactoryV2, Remove-AzureRmDataFactoryV2, Set-AzureRmDataFactoryV2LinkedService...}                      
Script     3.4.1      AzureRM.DataLakeAnalytics           {Get-AzureRmDataLakeAnalyticsDataSource, New-AzureRmDataLakeAnalyticsCatalogCredential, Remove-AzureRmDataLakeAnalyticsCatalogCredential, Remo...
Script     4.4.1      AzureRM.DataLakeStore               {Get-AzureRmDataLakeStoreTrustedIdProvider, Remove-AzureRmDataLakeStoreTrustedIdProvider, Remove-AzureRmDataLakeStoreFirewallRule, Set-AzureRm...
Script     3.4.1      AzureRM.DevTestLabs                 {Get-AzureRmDtlAllowedVMSizesPolicy, Get-AzureRmDtlAutoShutdownPolicy, Get-AzureRmDtlAutoStartPolicy, Get-AzureRmDtlVMsPerLabPolicy...}          
Script     3.4.1      AzureRM.Dns                         {Get-AzureRmDnsRecordSet, New-AzureRmDnsRecordConfig, Remove-AzureRmDnsRecordSet, Set-AzureRmDnsRecordSet...}                                    
Script     0.1.1      AzureRM.EventGrid                   {New-AzureRmEventGridTopic, Get-AzureRmEventGridTopic, Set-AzureRmEventGridTopic, New-AzureRmEventGridTopicKey...}                               
Script     0.4.7      AzureRM.EventHub                    {New-AzureRmEventHubKey, Get-AzureRmEventHubNamespace, Get-AzureRmEventHubNamespaceAuthorizationRule, Get-AzureRmEventHubNamespaceKey...}        
Script     3.4.1      AzureRM.HDInsight                   {Get-AzureRmHDInsightJob, New-AzureRmHDInsightSqoopJobDefinition, Wait-AzureRmHDInsightJob, New-AzureRmHDInsightStreamingMapReduceJobDefinitio...
Script     3.4.1      AzureRM.Insights                    {Get-AzureRmUsage, Get-AzureRmMetricDefinition, Get-AzureRmMetric, Remove-AzureRmLogProfile...}                                                  
Script     2.4.1      AzureRM.IotHub                      {Add-AzureRmIotHubKey, Get-AzureRmIotHubEventHubConsumerGroup, Get-AzureRmIotHubConnectionString, Get-AzureRmIotHubJob...}                       
Script     3.4.1      AzureRM.KeyVault                    {Add-AzureKeyVaultCertificate, Set-AzureKeyVaultCertificateAttribute, Stop-AzureKeyVaultCertificateOperation, Get-AzureKeyVaultCertificateOper...
Script     3.4.1      AzureRM.LogicApp                    {Get-AzureRmIntegrationAccountAgreement, Get-AzureRmIntegrationAccountCallbackUrl, Get-AzureRmIntegrationAccountCertificate, Get-AzureRmIntegr...
Script     0.15.7     AzureRM.MachineLearning             {Move-AzureRmMlCommitmentAssociation, Get-AzureRmMlCommitmentAssociation, Get-AzureRmMlCommitmentPlanUsageHistory, Remove-AzureRmMlCommitmentP...
Script     0.1.0      AzureRM.MachineLearningCompute      {Get-AzureRmMlOpCluster, Get-AzureRmMlOpClusterKey, Test-AzureRmMlOpClusterSystemServicesUpdateAvailability, Update-AzureRmMlOpClusterSystemSe...
Script     0.1.0      AzureRM.MarketplaceOrdering         {Get-AzureRmMarketplaceTerms, Set-AzureRmMarketplaceTerms}                                                                                       
Script     0.7.7      AzureRM.Media                       {Sync-AzureRmMediaServiceStorageKeys, Set-AzureRmMediaServiceKey, Get-AzureRmMediaServiceKeys, Get-AzureRmMediaServiceNameAvailability...}       
Script     4.4.1      AzureRM.Network                     {Add-AzureRmApplicationGatewayAuthenticationCertificate, Get-AzureRmApplicationGatewayAuthenticationCertificate, New-AzureRmApplicationGateway...
Manifest   0.9.1      AzureRM.Network.Netcore             {Add-AzureRmApplicationGatewayAuthenticationCertificate, Get-AzureRmApplicationGatewayAuthenticationCertificate, New-AzureRmApplicationGateway...
Script     3.4.1      AzureRM.NotificationHubs            {Get-AzureRmNotificationHub, Get-AzureRmNotificationHubAuthorizationRules, Get-AzureRmNotificationHubListKeys, Get-AzureRmNotificationHubPNSCr...
Script     3.4.1      AzureRM.OperationalInsights         {New-AzureRmOperationalInsightsAzureActivityLogDataSource, New-AzureRmOperationalInsightsCustomLogDataSource, Disable-AzureRmOperationalInsigh...
Script     3.4.1      AzureRM.PowerBIEmbedded             {Remove-AzureRmPowerBIWorkspaceCollection, Get-AzureRmPowerBIWorkspaceCollection, Get-AzureRmPowerBIWorkspaceCollectionAccessKeys, Get-AzureRm...
Script     3.4.1      AzureRM.profile                     {Disable-AzureRmDataCollection, Disable-AzureRmContextAutosave, Enable-AzureRmDataCollection, Enable-AzureRmContextAutosave...}                  
Manifest   0.9.1      AzureRM.Profile.Netcore             {Disable-AzureRmDataCollection, Enable-AzureRmDataCollection, Remove-AzureRmEnvironment, Get-AzureRmEnvironment...}                              
Script     3.4.1      AzureRM.RecoveryServices            {Get-AzureRmRecoveryServicesBackupProperty, Get-AzureRmRecoveryServicesVault, Get-AzureRmRecoveryServicesVaultSettingsFile, New-AzureRmRecover...
Script     3.4.1      AzureRM.RecoveryServices.Backup     {Backup-AzureRmRecoveryServicesBackupItem, Get-AzureRmRecoveryServicesBackupManagementServer, Get-AzureRmRecoveryServicesBackupContainer, Unre...
Script     3.4.1      AzureRM.RedisCache                  {Remove-AzureRmRedisCachePatchSchedule, New-AzureRmRedisCacheScheduleEntry, Get-AzureRmRedisCachePatchSchedule, New-AzureRmRedisCachePatchSche...
Script     0.2.7      AzureRM.Relay                       {New-AzureRmRelayNamespace, Get-AzureRmRelayNamespace, Set-AzureRmRelayNamespace, Remove-AzureRmRelayNamespace...}                               
Script     4.4.1      AzureRM.Resources                   {Get-AzureRmProviderOperation, Remove-AzureRmRoleAssignment, Get-AzureRmRoleAssignment, New-AzureRmRoleAssignment...}                            
Manifest   0.9.1      AzureRM.Resources.Netcore           {Get-AzureRmProviderOperation, Remove-AzureRmRoleAssignment, Get-AzureRmRoleAssignment, New-AzureRmRoleAssignment...}                            
Script     0.15.7     AzureRM.Scheduler                   {Disable-AzureRmSchedulerJobCollection, Enable-AzureRmSchedulerJobCollection, Get-AzureRmSchedulerJobCollection, Get-AzureRmSchedulerJob...}     
Script     3.4.1      AzureRM.ServerManagement            {Invoke-AzureRmServerManagementPowerShellCommand, Get-AzureRmServerManagementSession, New-AzureRmServerManagementSession, Remove-AzureRmServer...
Script     0.4.7      AzureRM.ServiceBus                  {New-AzureRmServiceBusNamespace, Get-AzureRmServiceBusNamespace, Set-AzureRmServiceBusNamespace, Remove-AzureRmServiceBusNamespace...}           
Script     0.2.7      AzureRM.ServiceFabric               {Add-AzureRmServiceFabricApplicationCertificate, Add-AzureRmServiceFabricClientCertificate, Add-AzureRmServiceFabricClusterCertificate, Add-Az...
Script     4.4.1      AzureRM.SiteRecovery                {Get-AzureRmSiteRecoveryFabric, New-AzureRmSiteRecoveryFabric, Remove-AzureRmSiteRecoveryFabric, Stop-AzureRmSiteRecoveryJob...}                 
Script     3.4.1      AzureRM.Sql                         {Get-AzureRmSqlDatabaseTransparentDataEncryption, Get-AzureRmSqlDatabaseTransparentDataEncryptionActivity, Set-AzureRmSqlDatabaseTransparentDa...
Script     3.4.1      AzureRM.Storage                     {Get-AzureRmStorageAccount, Get-AzureRmStorageAccountKey, New-AzureRmStorageAccount, New-AzureRmStorageAccountKey...}                            
Manifest   0.9.1      AzureRM.Storage.Netcore             {Get-AzureRmStorageAccount, Get-AzureRmStorageAccountKey, New-AzureRmStorageAccount, New-AzureRmStorageAccountKey...}                            
Script     3.4.1      AzureRM.StreamAnalytics             {Get-AzureRmStreamAnalyticsFunction, Get-AzureRmStreamAnalyticsDefaultFunctionDefinition, New-AzureRmStreamAnalyticsFunction, Remove-AzureRmSt...
Script     3.4.1      AzureRM.Tags                        {Remove-AzureRmTag, Get-AzureRmTag, New-AzureRmTag}                                                                                              
Manifest   0.9.1      AzureRM.Tags.Netcore                {Remove-AzureRmTag, Get-AzureRmTag, New-AzureRmTag}                                                                                              
Script     3.4.1      AzureRM.TrafficManager              {Disable-AzureRmTrafficManagerEndpoint, Enable-AzureRmTrafficManagerEndpoint, Set-AzureRmTrafficManagerEndpoint, Get-AzureRmTrafficManagerEndp...
Script     3.4.1      AzureRM.UsageAggregates             Get-UsageAggregates                                                                                                                              
Script     3.4.1      AzureRM.Websites                    {Get-AzureRmAppServicePlan, Set-AzureRmAppServicePlan, New-AzureRmAppServicePlan, Remove-AzureRmAppServicePlan...}                               
Manifest   0.9.1      AzureRM.Websites.Netcore            {Get-AzureRmAppServicePlan, Set-AzureRmAppServicePlan, New-AzureRmAppServicePlan, Remove-AzureRmAppServicePlan...}   

سلوك متوقع

أتوقع أن أتمكن من إزالة تثبيت وحدة AzureRM

بيانات البيئة

توفير ناتج $ PSVersionTable
> $PSVersionTable
Name                           Value                                                                                                                                                                       
----                           -----                                                                                                                                                                       
PSVersion                      6.0.0-beta.9                                                                                                                                                                
PSEdition                      Core                                                                                                                                                                        
GitCommitId                    v6.0.0-beta.9                                                                                                                                                               
OS                             Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64                                                              
Platform                       Unix                                                                                                                                                                        
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                     
PSRemotingProtocolVersion      2.3                                                                                                                                                                         
SerializationVersion           1.1.0.1                                                                                                                                                                     
WSManStackVersion              3.0     
Area-PowerShellGet Resolution-External

التعليق الأكثر فائدة

فقط في حال كان هذا يساعد أي شخص ، كنت أواجه نفس المشكلة والأمر:
Get-Module -ListAvailable | Where-Object {$_.Name -like 'AzureRM*'} | Uninstall-Module
أزلت بنجاح الوحدات النمطية المتوقعة (تأكد من تشغيل powerhell مثل sudo إذا كانت هذه هي الطريقة التي قمت بتثبيت الوحدات بها لتبدأ)

ال 3 كومينتر

@ Michal-Ziemba هل يمكنك فتح هذا العدد هنا؟ https://github.com/powershell/powershellget/issues

فقط في حال كان هذا يساعد أي شخص ، كنت أواجه نفس المشكلة والأمر:
Get-Module -ListAvailable | Where-Object {$_.Name -like 'AzureRM*'} | Uninstall-Module
أزلت بنجاح الوحدات النمطية المتوقعة (تأكد من تشغيل powerhell مثل sudo إذا كانت هذه هي الطريقة التي قمت بتثبيت الوحدات بها لتبدأ)

mszu شكرا!
@ SteveL-MSFT تم

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات