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
Param( | |
[Parameter(Mandatory = $true, Position = 0)] [string] $configName, | |
[Parameter(Mandatory = $true, Position = 1)] [string] $TFSUri, | |
[Parameter(Mandatory = $true, Position = 2)] [string] $environmentName, | |
[Parameter(Mandatory = $true, Position = 3)] [string] $username, | |
[Parameter(Mandatory = $true, Position = 4)] [string] $password, | |
[Parameter(Mandatory = $false, Position = 5)] [bool] $defaultStopWebsiteForDeployment = $true, | |
[Parameter(Mandatory = $false, Position = 6)] [int] $defaultStopWebsiteForDeploymentWaitSeconds = 22 | |
) |
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
D, [2017-03-22T06:04:10.979811 #16824] DEBUG -- acme-win-webdefault-nano: Berksfile found at D:/Github/TDDwithChefDSCPester/cookbooks/acme_win_web/Berksfile, loading Berkshelf | |
D, [2017-03-22T06:04:12.430329 #16824] DEBUG -- acme-win-webdefault-nano: Berkshelf 5.6.4 library loaded | |
D, [2017-03-22T06:04:12.431462 #16824] DEBUG -- acme-win-webdefault-nano: winrm requested, loading winrm gem (["~> 2.0"]) | |
D, [2017-03-22T06:04:12.727548 #16824] DEBUG -- acme-win-webdefault-nano: winrm is loaded. | |
D, [2017-03-22T06:04:12.728548 #16824] DEBUG -- acme-win-webdefault-nano: winrm-fs requested, loading winrm-fs gem (["~> 1.0"]) | |
D, [2017-03-22T06:04:12.885544 #16824] DEBUG -- acme-win-webdefault-nano: winrm-fs is loaded. | |
I, [2017-03-22T06:04:12.888568 #16824] INFO -- acme-win-webdefault-nano: -----> Verifying <acme-win-webdefault-nano>... | |
I, [2017-03-22T06:04:12.892050 #16824] INFO -- acme-win-webdefault-nano: Preparing files for transfer | |
D, [2017-03-22T06:04:12.893021 #16824] DEBUG -- acme-win-webdefault-nano: Creating l |
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
--- | |
driver: | |
name: hyperv | |
vm_switch: DefaultExternalSwitch | |
parent_vhd_folder: D:\VirtualMachines | |
parent_vhd_name: NanoDSC_2017.03.19.vhd | |
username: administrator | |
password: admin777! | |
memory_startup_bytes: 1073741824 |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<AutoDeployOnVSBuild>true</AutoDeployOnVSBuild> | |
<!--<AutoDeployOnVSBuild>false</AutoDeployOnVSBuild>--> | |
<AutoDeployPublishProfileName>LocalFile</AutoDeployPublishProfileName> | |
</PropertyGroup> | |
<Target Name="AfterBuild"> | |
<MSBuild | |
Condition="'$(AutoDeployOnVSBuild)'=='true' AND '$(DeployOnBuild)'!='true'" |
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
$acl = Get-Acl $sitePath | |
$permission = "$userDomain\$username","FullControl",$inherit,$propagation,"Allow" | |
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule ($permission) | |
$acl.AddAccessRule($accessRule) | |
$acl | Set-Acl $sitePath |
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 PrepareSourceForGithub { | |
Param( | |
[string]$tfsUrl, | |
[string]$tfsCollection = 'defaultcollection', | |
[string]$folderPath, | |
[string]$newRepoName | |
) | |
$sourceZip = "source.zip" | |
$sourceZipUrl = "http://$tfsUrl/$tfsCollection/_apis/tfvc/items?path=$folderPath&api-version=1.0" | |
Write-Host "Please provide you TFS credentials:" |
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
public class RemoteModelValidatorAttribute : RemoteAttribute | |
{ | |
public RemoteModelValidatorAttribute(Type modelType, string action, string controller) :base(action, controller) | |
{ | |
AdditionalFields = string.Join(",", modelType.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance).Select(p => p.Name)); | |
} | |
} |
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
[RemoteModelValidator(typeof(MyModel), "ValidateModelFields", "MyController")] | |
public string State { get; set; } |
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
protected JsonResult RemoteJsonResponseForProperty(string property = null) | |
{ | |
object response; | |
if (string.IsNullOrWhiteSpace(property)) | |
{ | |
property = System.Web.HttpContext.Current.Request.QueryString.Keys[0]; | |
} | |
if (ModelState.ContainsKey(property) && ModelState[property].Errors.Any()) |
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
public static string GetName<T>(this Expression<Func<T>> action) | |
{ | |
return GetNameFromMemberExpression(action.Body); | |
} | |
static string GetNameFromMemberExpression(Expression expression) { | |
if (expression is MemberExpression) { | |
return (expression as MemberExpression).Member.Name; | |
} | |
else if (expression is UnaryExpression) { |