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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
<!-- .... --> | |
<!-- | |
Add .svc to let build tool to substitute$SharePoint.Project.AssemblyFullName$ like | |
placeholders during build process. | |
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
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { | |
Add-PSSnapin "Microsoft.SharePoint.PowerShell" | |
} | |
$web = Get-SPWeb 'http://win13a/sites/dev' | |
$web.AllProperties['PropertyName'] = '312' | |
$web.Update() | |
$webApp = Get-SPWebApplication 'http://win13a/' |
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
SPDiagnosticsService.Local.WriteTrace(0, | |
new SPDiagnosticsCategory(this.NamingContainer.ToString(), | |
TraceSeverity.Unexpected, | |
EventSeverity.Error), | |
TraceSeverity.Unexpected, | |
ex.Message, | |
ex.StackTrace); |
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
# on local machine create private/public keys in .ssh folder | |
ssh-keygen -t rsa | |
# cp pk on remote server | |
scp .ssh/id_rsa.pub remote-user-name@remote-host-name:.ssh/authorized_keys2 | |
# map local user on different user on remote server | |
# |
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
Get-Datastore *TEMPLATE* | | |
% {Get-ChildItem $_.DatastoreBrowserPath } | | |
Select-Object @{Name="DS" ; Expression={ $_.fullName.split('\')[-2]}}, | |
@{Name="CONT" ; Expression = {$_.fullName.split('\')[-1]}} |
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
public class CustomImpersonationContext :ImpersonationContext | |
{ | |
public static void Setup(string user, string pwd, string domain) { | |
User = user; | |
Pwd = pwd; | |
Domain = domain; | |
} | |
public static string User { get; private set; } |
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
if (! (Test-Path variable:global:excelApp)){ | |
$global:excelApp = $null | |
} | |
function createExcel(){ | |
if ($global:excelApp -eq $null){ | |
doEng({ | |
Write-Host 'new excel app' | |
$global:excelApp = New-Object -comobject Excel.Application | |
$global:excelApp.visible = $true |
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
function Get-ViewPool($viewAddress,$cred){ | |
$poolsAddr = "LDAP://$viewAddress/OU=Server Groups,DC=vdi,DC=vmware,DC=int" | |
$poolsAppAddr = "LDAP://$viewAddress/OU=Applications,DC=vdi,DC=vmware,DC=int" | |
$membersAddr = "LDAP://$viewAddress/CN=ForeignSecurityPrincipals,DC=vdi,DC=vmware,DC=int" | |
if ($cred -eq $null){ | |
$poolContainer = [adsi] $poolsAddr |
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
function Escape-JSONString($str){ | |
if ($str -eq $null) {return ""} | |
$str = $str.ToString().Replace('"','\"').Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("`t",'\t') | |
return $str; | |
} | |
function ConvertTo-JSON($maxDepth = 4,$forceArray = $false) { | |
begin { | |
$data = @() | |
} |