user2248241
user2248241

Reputation: 1

Error running ps1 from c# code (Office 365)

When creating the sharepoint site using ps1 file from C# code in office365. This error is coming The 'connect-sposervice' command was found in the module 'Microsoft.Online.SharePoint.PowerShell', but the module could not be loaded. For more information, run 'Import-Module Microsoft.Online.SharePoint.PowerShell'.

Running the ps1 directly in powershell is giving the desired result, but not working properly using c# code

Upvotes: 0

Views: 757

Answers (1)

Jose Alonso Monge
Jose Alonso Monge

Reputation: 1034

I had the same problem and solve it this way:

Locate file

C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.PowerShell.psd1

and change this line

# Processor architecture (None, X86, Amd64, IA64) required by this module
ProcessorArchitecture = 'Amd64'

for this one:

# Processor architecture (None, X86, Amd64, IA64) required by this module
ProcessorArchitecture = 'X86'

I don't know if it's a good solution, but it's works for me. Any suggestion is wellcome

Upvotes: 0

Related Questions