PublicIPAddress
1.1.1
Most Internet-connections, especially wireless connections have dynamic IP-address that will change at times.
As such it may prove to be challenging to remotely connect to your comput
Most Internet-connections, especially wireless connections have dynamic IP-address that will change at times.
As such it may prove to be challenging to remotely connect to your computer from the Internet. One of the most popular ways to address the issue is to use a service such as DynDNS which provices a static hostname, eg myhomecomputer.domain.net.
But unless you actually need to use a static hostname, an alternative way is to leverage Dropbox, OneDrive, Google Drive or similar cloud service to store public IP-address of your computer in a file.
All you need is a way to periodically check current public IP-address and save that to a file located in a directory that will be synced to a cloud service, which you can then read on your phone or any other computer with access to the Internet.
This PowerShell module provides a function to check current public IP-address and write the IP-address to a file in specified directory. In addition to this, a scheduled task can be created to do this periodically.
If you intend to use a scheduled task, this module should be installed to %systemdrive%:\Program Files\WindowsPowerShell\Modules. Otherwise SYSTEM account cannot find this module and use its functions.
Administrator privileges will also be required to create a scheduled task.
When installing this module from the PowerShell Gallery, use "Install-Module -Name PublicIPAddress -Scope AllUsers" in order to install the module to Program Files.
Queries for IP-address should be limited to no more than once per five minutes. Otherwise your queries my be dropped.
Minimum PowerShell version
3.0
Installation Options
Owners
Copyright
(c) 2016 Juho Lehto. All rights reserved.
Package Details
Author(s)
- Juho Lehto
Tags
Functions
Get-PublicIPAddress Save-PublicIPAddress
Dependencies
This module has no dependencies.
Release Notes
1.0
- Initial release.
1.1
- Save-PublicIPAddress now checks that PowerShell is running with Administrator privileges when using the ScheduledTask switch. Appropriate error message is thrown when running with insufficient privileges.
- Save-PublicIPAddress now creates scheduled task to run as NT AUTHORITY\SYSTEM account, instead of NT AUTHORITY\LOCAL SERVICE. The LOCAL SERVICE account may not have sufficient filesystem permissions to the directory given as argument to the Path parameter, whereas SYSTEM should.
- Updated description of this module.
1.1.1
- Missed one reference to LOCAL SERVICE, which has now been changed to SYSTEM.
FileList
- PublicIPAddress.nuspec
- PublicIPAddress.psd1
- PublicIPAddress.psm1
Version History
Version | Downloads | Last updated |
---|---|---|
1.1.1 (current version) | 1,417 | 11/24/2016 |
1.1 | 21 | 11/24/2016 |
1.0 | 27 | 11/23/2016 |