![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Simple doubt I want to open http://servername:2381 using powershell. $servername=$args #$colon=':' #$port=2381 $fullpath=$servername+$colon+$port $oIE=new-object -com internetexplorer.application $oIE.navigate2("https://$fullpath") $oIE.Visible=$true But this doesn't work, it takes spaces...Need simple advice to achieve it. Thank you for your kind advice. Preetam |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Simple doubt so the first thing is you have the colon and port commented out.. is the other issue that the SERVERNAME has spaces in it? i can't recall off the top of my head, but in System.Web there are some utility functions specifically for URLs and encoding %20 etc |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Simple doubt You are assigning $args to $servername. $args is one of PowerShell's automatic variables and it will contain unassigned parameters passed to a function or a script. Assign 'servername:2381' instead: $servername='servername:2381' #$colon=':' #$port=2381 $fullpath=$servername+$colon+$port $oIE=new-object -com internetexplorer.application $oIE.navigate2("https://$fullpath") $oIE.Visible=$true ....or this way: $server name='server name' $colon=':' $port=2381 $full path=$servername+$colon+$port $oIE=new-object -com internetexplorer.application $oIE.navigate2("https://$fullpath") $oIE.Visible=$true If you want to read about automatic variables: help about_automatic_variables -- Kiron |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Simple doubt Typo on the second option: $servername='server name' ....should be: $servername='servername' $colon=':' $port=2381 $fullpath=$servername+$colon+$port $oIE=new-object -com internetexplorer.application $oIE.navigate2("https://$fullpath") $oIE.Visible=$true Sorry. -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Doubt in word | Microsoft Office | |||
| I doubt you can help but doesn't hurt to ask | Network & Sharing | |||
| clarify my doubt | Vista installation & setup | |||
| For those in doubt of Microsoft shares... | Vista General | |||