patrix87 / PowerShellGSM

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.
https://github.com/patrix87/PowerShellGSM/
MIT License
111 stars 19 forks source link

Error invoke-webrequest to get external IP #5

Closed Moubai closed 2 years ago

Moubai commented 2 years ago

Hello, i Get this error when i launch the script for satisfactory

Invoke-WebRequest : Le contenu de la réponse ne peut pas être analysé, car le moteur d’Internet Explorer n’est pas disponible ou la configuration du premier lancement d’Internet Explorer n’est pas complète. Spécifiez le paramètre UseBasicParsing et réessayez. Au caractère D:\server\PowerShellGSM-2.6.6\functions\network\Set-IP.psm1:9 : 20

  • $ExternalIP = (Invoke-WebRequest ifconfig.me/ip).Content.Trim()
  • 
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestComman
    d

Internet explorer is not initialized, (i've never launch internet explorer on this windows, and when we launch it now it launch Edge instead)

i've modified the cmd to use -UseBasicParsing it work well

#Get current external ip from ifconfig.me
$GetIP= Invoke-WebRequest ifconfig.me/ip -UseBasicParsing
$ExternalIP = $GetIP.Content.Trim()

Set-IP.txt

patrix87 commented 2 years ago

Do you have Internet Explorer installed or enabled on the server ?

On Tue., Nov. 2, 2021, 15:47 Moubai, @.***> wrote:

Hello, i Get this error when i launch the script for satisfactory

Invoke-WebRequest : Le contenu de la réponse ne peut pas être analysé, car le moteur d’Internet Explorer n’est pas disponible ou la configuration du premier lancement d’Internet Explorer n’est pas complète. Spécifiez le paramètre UseBasicParsing et réessayez. Au caractère D:\server\PowerShellGSM-2.6.6\functions\network\Set-IP.psm1:9 : 20

-

$ExternalIP = (Invoke-WebRequest ifconfig.me/ip).Content.Trim()

-

              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    • FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestComman d

Internet explorer is not initialized, (i've never launch internet explorer on this windows, and when we launch it now it launch Edge instead)

i've modified the cmd to use -UseBasicParsing it work well

Get current external ip from ifconfig.me $GetIP= Invoke-WebRequest

ifconfig.me/ip -UseBasicParsing $ExternalIP = $GetIP.Content.Trim() Set-IP.txt https://github.com/patrix87/PowerShellGSM/files/7463601/Set-IP.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/patrix87/PowerShellGSM/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQLR5XLN2UO7XIPIABBX53UKA54LANCNFSM5HHIYVMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

patrix87 commented 2 years ago

Oh sorry I read too fast, I'll test it and add it to the next release then.

On Tue., Nov. 2, 2021, 15:47 Moubai, @.***> wrote:

Hello, i Get this error when i launch the script for satisfactory

Invoke-WebRequest : Le contenu de la réponse ne peut pas être analysé, car le moteur d’Internet Explorer n’est pas disponible ou la configuration du premier lancement d’Internet Explorer n’est pas complète. Spécifiez le paramètre UseBasicParsing et réessayez. Au caractère D:\server\PowerShellGSM-2.6.6\functions\network\Set-IP.psm1:9 : 20

-

$ExternalIP = (Invoke-WebRequest ifconfig.me/ip).Content.Trim()

-

              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    • FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestComman d

Internet explorer is not initialized, (i've never launch internet explorer on this windows, and when we launch it now it launch Edge instead)

i've modified the cmd to use -UseBasicParsing it work well

Get current external ip from ifconfig.me $GetIP= Invoke-WebRequest

ifconfig.me/ip -UseBasicParsing $ExternalIP = $GetIP.Content.Trim() Set-IP.txt https://github.com/patrix87/PowerShellGSM/files/7463601/Set-IP.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/patrix87/PowerShellGSM/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQLR5XLN2UO7XIPIABBX53UKA54LANCNFSM5HHIYVMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Moubai commented 2 years ago

it was on windows 10 21h1, pretty sure we can reproduce the pb on a fresh VM

patrix87 commented 2 years ago

Fixed in last release.