Hi @H Risbud ,
I'm glad to hear you solve the problem ,if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[Import-Module : Could not load file or assembly 'System.Management.Automation] Issue Symptom: unable to run PnP PowerShell commands using PowerShell ISE in administrative mode. Getting following error
Import-Module : Could not load file or assembly 'System.Management.Automation, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Solution:
- Uninstall all versions and then install correct 1.12.0 version. Newer version PnP PowerShell 2.1.1 has issues #1. This issue happened with newer version PnP PowerShell 2.1.1.
- Set Tls12 protocol
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- Install NuGet
Install-PackageProvider -Name nuget -MinimumVersion 2.8.5.201 -force
- Install PnP.PowerShell with version 1.12.0
Install-Module -Name "PnP.PowerShell" -RequiredVersion 1.12.0 -Force -AllowClobber
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!