Issues with 2019 install and Invoke-WebRequest

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
CodSup01
Posts: 9
Joined: Sun Nov 13, 2016 2:01 pm

Re: Issues with 2019 install and Invoke-WebRequest

Post by CodSup01 » Mon Feb 25, 2019 3:05 pm

Hi David,

I appear to have this working now, the scriptdriver64.exe.config looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" />
      <supportedRuntime version="v2.0" />
      <section name="uri" type="System.Configuration.UriSection, System,                           Version=4.0.0.0, Culture=neutral,                           PublicKeyToken=b77a5c561934e089" />
      <uri>
         <schemeSettings>
            <add name="http|https" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
         </schemeSettings>
      </uri>
   </startup>
</configuration>

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Issues with 2019 install and Invoke-WebRequest

Post by davidc » Mon Feb 25, 2019 3:07 pm

The Uri section is valid. In addition, PowerShell.exe's config file has the same section. The only difference is that our config file has the startup element:

Code: Select all

<startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
</startup>
1. Does the error still occur if you remove this section?
2. If item 1 works, try inserting the startup element after the uri element.
David
SAPIEN Technologies, Inc.

User avatar
CodSup01
Posts: 9
Joined: Sun Nov 13, 2016 2:01 pm

Re: Issues with 2019 install and Invoke-WebRequest

Post by CodSup01 » Tue Feb 26, 2019 6:00 am

Hi David,

The issue still occurs after removing the startup config.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Issues with 2019 install and Invoke-WebRequest

Post by davidc » Tue Feb 26, 2019 8:22 am

We are updating the ScriptDriver config file as follows:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
    </startup>
	<configSections> 
		<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
	</configSections> 
	<uri>
		<schemeSettings>
			<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
			<add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
		</schemeSettings>
	</uri>
</configuration>
Please verify that this works for you.
David
SAPIEN Technologies, Inc.

User avatar
CodSup01
Posts: 9
Joined: Sun Nov 13, 2016 2:01 pm

Re: Issues with 2019 install and Invoke-WebRequest

Post by CodSup01 » Tue Feb 26, 2019 12:25 pm

Hi David,

Now receiving the following error:

Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element. (C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2019\Debugger64\scriptdriver64.exe.Config line 7)

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Issues with 2019 install and Invoke-WebRequest

Post by davidc » Tue Feb 26, 2019 3:03 pm

Looks like the configSections element has to be at the top. Try this:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
	<configSections> 
		<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
	</configSections> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
    </startup>
	<uri>
		<schemeSettings>
			<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
			<add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
		</schemeSettings>
	</uri>
</configuration>
David
SAPIEN Technologies, Inc.

User avatar
CodSup01
Posts: 9
Joined: Sun Nov 13, 2016 2:01 pm

Re: Issues with 2019 install and Invoke-WebRequest

Post by CodSup01 » Wed Feb 27, 2019 7:47 am

Hi David,

That did the trick, thanks for all your help.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Issues with 2019 install and Invoke-WebRequest

Post by davidc » Wed Feb 27, 2019 8:40 am

I'm glad to hear it and thank you for the update. We will include the new config in the next service release.
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Issues with 2019 install and Invoke-WebRequest

Post by davidc » Wed Mar 06, 2019 11:06 am

We release a new service build of PowerShell Studio (v5.6.160) with the updated config file.
David
SAPIEN Technologies, Inc.