This file contains 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()] | |
Param ([Parameter(Mandatory=$true, HelpMessage="Current site URL?")][ValidateNotNullOrEmpty()][string]$oldUrl, | |
[Parameter(Mandatory=$true, HelpMessage="Desired new site URL?")][ValidateNotNullOrEmpty()][string]$newUrl) | |
$validate = Get-SPSite $newUrl; | |
if ($validate -eq $null) | |
{ | |
try | |
{ | |
$site = Get-SPSite $oldUrl; | |
$site.Rename($newUrl); |
This file contains 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
$list = @(); #Initialize the array. | |
$list += "Apple"; #$list = "Apple" | |
$list += "Orange"; #$list = "Apple", "Orange" | |
$list += "Tomato"; #$list = "Apple", "Orange", "Tomato" | |
$list += "Grape"; #$list = "Apple", "Orange", "Tomato", "Grape" | |
$list -= "Tomato"; # ERROR!!! You can't do this! | |
#but this works | |
$list = $list -ne "Tomato"; #$list = "Apple", "Orange", "Grape" |
This file contains 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
$array = @("a", "b", "c", "b", "d", "a"); #Setup the array. | |
$array = $array | sort -unique; #Sort the array while using only unique values. |
This file contains 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
SELECT * | |
FROM tblSites | |
GROUP BY Url | |
HAVING count(Url) = 1; |
NewerOlder