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
param($websitename = 'TEst' ,$resourceGroup = 'SchuTest',$slot = 'production', $appSettings ='{"AppSettings:testkey1": "45test","AppSettings:TestId": "This is a Test Key 28"}') | |
#https://stackoverflow.com/questions/8800375/merging-hashtables-in-powershell-how | |
Function Merge-Hashtables([ScriptBlock]$Operator) { | |
$Output = @{} | |
ForEach ($Hashtable in $Input) { | |
If ($Hashtable -is [Hashtable]) { | |
ForEach ($Key in $Hashtable.Keys) {$Output.$Key = If ($Output.ContainsKey($Key)) {@($Output.$Key) + $Hashtable.$Key} Else {$Hashtable.$Key}} | |
} | |
} | |
If ($Operator) {ForEach ($Key in @($Output.Keys)) {$_ = @($Output.$Key); $Output.$Key = Invoke-Command $Operator}} |
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 Write-User | |
{ | |
param( | |
[parameter(mandatory)] | |
[string]$fileName | |
) | |
write-output "Username: $env:UserName" | tee-object -filepath $filename | |
write-output "Current Command: $($MyInvocation.MyCommand.Path)" | tee-object -filepath $filename | |
write-output "Current Script: $($MyInvocation.MyCommand.ScriptName)"| tee-object -filepath $filename |
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
param | |
( | |
[String] [Parameter(Mandatory)] | |
$SolutionFile, | |
#this is the evironment that is in the Solution config to read where things need to go (TEST/DEV/QA/Prodution) | |
#for example - C:\tfs2013\Test Automated Deployment Sharepoint.rptproj | |
[string] [Parameter(Mandatory)] $Environment, | |
#this is the name of the Datasource as it exists in Sharepoint without the .rsds extension | |
[string] [Parameter(Mandatory)] $DataSource, | |
#This is the connection string that will be set for the report data source. |
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
#Requires -Version 5.0 | |
#------------------------------------------------------------------------ | |
# Source File Information (DO NOT MODIFY) | |
# Source ID: 8967ce63-8512-4998-b597-b65331d6a9f6 | |
# Source File: subscriptionExporter.psf | |
#------------------------------------------------------------------------ | |
#region File Recovery Data (DO NOT MODIFY) | |
<#RecoveryData: | |
d00BAB+LCAAAAAAABACMu9eOs0CbLnreUt/Dr/+U0ZhosDQzEjlHk8/IGUwy4ep39QTtJe0tzfpa | |
beHPVLnqDU8A+t+cIpu+xXJxyZb8AxyszTT++z/Rf0X++R+/P//4x7+ZS1M1Y9ILTV8YyVD8x7qn |
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 Compare-ObjectEquivalence { | |
[CmdletBinding(DefaultParameterSetName='Deserialized')] | |
param( | |
[Parameter(Position=0, Mandatory=$true)] | |
[ValidateNotNull()] | |
[System.Object] | |
$OriginalObject, | |
[Parameter(Position=1, Mandatory=$true, ParameterSetName='Deserialized')] | |
[ValidateNotNull()] |
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
$reportExportPath = 'C:\temp\reports' | |
$reportFiles = Get-ChildItem $reportExportPath -Filter *.xml | |
foreach($file in $reportFiles) | |
{ | |
$reportobject = Import-Clixml -path ($file.fullname) | |
#$extensionsettings = [SSRSProxy.ExtensionSettings]::new() | |
$extensionSettings = New-Object -typename 'SSRSProxy.ExtensionSettings' | |
$extensionSettings.Extension = $reportobject.Subscriptions.properties.extensionSettings.Extension | |
$paramvalues = @() | |
foreach($parameterField in $reportobject.Subscriptions.properties.extensionSettings.ParameterValues) |
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
#requires -version 5.0 | |
function Get-DataDrivenSubscriptionProperties | |
{ | |
param([object] $Subscription, | |
[object]$ssrsproxy) | |
$ssrsobject = [SSRSObject]::New() | |
$sid = $Subscription.SubscriptionID | |
$ddextensionSettings = $ddDataRetrievalPlan = $ddDescription = $ddactive = $ddstatus = $ddeventtype = $ddmatchdata = $ddparameters = $Null | |
$ddOwner = $ssrsproxy.GetDataDrivenSubscriptionProperties($sid,[ref]$ddextensionSettings,[ref]$ddDataRetrievalPlan` | |
,[ref]$ddDescription,[ref]$ddactive,[ref]$ddstatus,[ref]$ddeventtype,[ref]$ddmatchdata,[ref]$ddparameters) |
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
<# | |
.Synopsis | |
Rough PS functions to create new user profiles | |
.DESCRIPTION | |
Call the Create-NewProfile function directly to create a new profile | |
.EXAMPLE | |
Create-NewProfile -Username 'testUser1' -Password 'testUser1' | |
.NOTES | |
Created by: Josh Rickard (@MS_dministrator) and Thom Schumacher (@driberif) |
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 CreateProfile | |
{ | |
param([String]$UserSid, [String]$UserName, [system.uint32]$ProfilePath) | |
Add-Type -TypeDefinition ' | |
using System; | |
using System.Runtime.InteropServices; | |
public static class PInvoke { | |
[DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
public static extern int CreateProfile( [MarshalAs(UnmanagedType.LPWStr)] String pszUserSid, [MarshalAs(UnmanagedType.LPWStr)] String pszUserName, [Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszProfilePath, uint cchProfilePath); | |
} |
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 Backup-TFSReleaseDefinitions | |
{ | |
param([object]$tfsprojs,$tfsurl = 'mytfsinstance.com', $tfscollection = 'Defaultcollection', $apiversion = '3.0-preview',[string]$Path = 'c:\temp\tfsprojects') | |
$tfsInstance = "http://$($tfsurl):8080/tfs/$tfsCollection" | |
foreach($tfsproj in $tfsprojs.value) | |
{ | |
$tfsProjName = $tfsproj.name | |
$tfsdev = "$tfsInstance/$tfsProjName" | |
$projectIds = Invoke-RestMethod -Method Get -UseDefaultCredentials -uri "$tfsdev/_apis/release/definitions?api-version=$apiversion" -ContentType application/json |