Srinu3366 / readPiPoChannels

Channel parameters download from SAP PI system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run the script

dharm910 opened this issue · comments

On PI 7.5 SP13 , I am getting below error - The login screen comes however, it doesn't run after that and below are the errors from powershell console.

PS C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master> C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetailsfromPI.ps1
ConvertFrom-Json : Invalid object passed in, ':' or '}' expected. (1): {
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:14 char:47

  • $properties = Get-Content .\Properties.json | ConvertFrom-Json
  •                                           ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    • FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Reading Channel Names.....
Exception calling "Create" with "1" argument(s): "Invalid URI: The URI is empty."
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:5 char:5

  • $soapWebRequest = [System.Net.WebRequest]::Create($url)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : UriFormatException

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:6 char:5

  • $soapWebRequest.Headers.Add("SOAPAction", "query")
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:7 char:5

  • $soapWebRequest.Headers.Add("Authorization", $authorization)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

The property 'ContentType' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:8 char:5

  • $soapWebRequest.ContentType = "text/xml;charset=utf-8"
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

The property 'Accept' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:9 char:5

  • $soapWebRequest.Accept = "text/xml"
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

The property 'Method' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:10 char:5

  • $soapWebRequest.Method = "POST"
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

The property 'UseDefaultCredentials' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:11 char:5

  • $soapWebRequest.UseDefaultCredentials = $true
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : PropertyNotFound

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:14 char:5

  • $requestStream = $soapWebRequest.GetRequestStream()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Multiple ambiguous overloads found for "Save" and the argument count: "1".
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:15 char:5

  • $payload.Save($requestStream)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodException
    • FullyQualifiedErrorId : MethodCountCouldNotFindBest

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:16 char:5

  • $requestStream.Close()
    
  • ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:19 char:5

  • $resp = $soapWebRequest.GetResponse()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:20 char:5

  • $responseStream = $resp.GetResponseStream()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:22 char:5

  • $ReturnXml = [Xml] $soapReader.ReadToEnd()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\functions\CallP
IChannelService.ps1:23 char:5

  • $responseStream.Close()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:39 char:22

  • foreach ($channel in $ReturnXml.GetElementsByTagName('rn3:CommunicationChannelID ...
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Reading Channel XML configuration.....
Preparing Excel Output...
New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed
due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:109 char:10

  • $excel = New-Object -ComObject excel.application
  •      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
    • FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand

The property 'visible' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:110 char:1

  • $excel.visible = $false
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : PropertyNotFound
    
    

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:111 char:1

  • $workbook = $excel.Workbooks.Add()
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:165 char:1

  • $workbook.SaveAs($outputpath)
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    

You cannot call a method on a null-valued expression.
At C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master\GetChannelDetai
lsfromPI.ps1:166 char:1

  • $excel.Quit()
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
    
    
    

PS C:\Users\localuser\Desktop\readPiPoChannels-master\readPiPoChannels-master\readPiPoChannels-master>