This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding(DefaultParameterSetName='Default')] | |
param | |
( | |
[Parameter(ParameterSetName = 'Default', | |
Mandatory=$true, | |
Position = 0)] | |
[String[]]$Word, | |
[Parameter(ParameterSetName = 'Default', | |
Position = 1)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Oneliner: | |
Invoke-RestMethod -Uri http://telize.com/geoip | Select-Object -Property longitude, latitude, continent_code, timezone | |
# Advanced function: | |
Function Get-GeoInformation | |
{ | |
<# | |
.Synopsis | |
Get geo information for current IP address or | |
any specified IP address. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Init { | |
$File = "$env:tmp\testfile.tmp" | |
if(-Not (Test-Path -Path $File)){[Void](New-Item -Path $File -Type File)} | |
Start-Service -Name Spooler | |
} | |
Function Validate { | |
$File = "$env:tmp\testfile.tmp" | |
$FileStatus = if(Test-Path -Path $File){'Exists'}else{'Removed'} | |
$SrvStatus = (Get-Service -Name Spooler).Status |
NewerOlder