11-27-2008
Downloads: 357
File size: 188 B
Views: 1,521
Embed
 |
Analyze URL |
- $result = [System.uri]'http://powershell.com/cs/forums/'
- $result
-
- "You are using Port $($result.port)."
- "Page comes from $($result.Authority)."
- "Served using $($result.Scheme)."
Sometimes, you may want to disassemble a URL and retrieve specific information, for example the port used, the top level domain or the url scheme. Instead of manually extracting this information, simply cast the URL to System.URI. Then, all information about your URL is conveniently accessible via individual properties.