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
| |
$LowDisk = 0.20 | |
$timestamp = get-date | |
$disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" | Select-Object Size,FreeSpace | |
$freespace= $disk.FreeSpace / $disk.Size | |
| |
| |
if($freespace -lt $LowDisk ){ | |
$folders = @( | |
'C:\Octopus\Files', |
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
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$rss = (new-object net.webclient) | |
#Set the username for windows auth proxy | |
$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials | |
$a = ([xml]$rss.downloadstring("https://s.ch9.ms/Events/Build/2016/rss?media=True&tag[0]=.net&tag[1]=application-insights&tag[2]=asp.net&tag[3]=azure&tag[4]=csharp&tag[5]=cordova&tag[6]=data&tag[7]=devops&tag[8]=diagnostics&tag[9]=internet-of-things&tag[10]=javascript&tag[11]=machine-learning&tag[12]=managed-languages&tag[13]=node.js&tag[14]=open-source&tag[15]=security&tag[16]=testing&tag[17]=typescript&tag[18]=visual-studio&tag[19]=visual-studio-code&tag[20]=web-platform")) | |
$a.rss.channel.item | foreach{ | |
try{ | |
$urlstring=$_."group"."content" | where-object type -eq "video/mp4" | select -ExpandProperty url | where {$_ -notlike "*_mid.mp4"} | select-object -first 1 | |
$url = New-Object System.Uri($urlstring) |
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
namespace QS.Admin.Controllers | |
{ | |
public class BusinessesController : CommandQueryControllerBase | |
{ | |
private IRepository _repository; | |
public BusinessController(IRepository repository){ | |
_repository=repository; | |
} | |
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
use the user-data-dir to create a new instance of chrome that will can stream to a chromecast, once you start up this instance the first time, you need to install the chromecast extension. | |
Launch this app and then start casting. | |
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=c:\temp\chrome1 url |
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
[Test] | |
[TestCaseSource("DocumentContent")] | |
public void Every_Content_type_Should_have_A_categorizer(string documentContentType) | |
{ | |
allTypes.Any(s => s.Name.Contains(documentContentType + "DocumentContentCategorizer")).ShouldBeTrue(String.Format("{0} does not have a DocumentContentCategorizer.", documentContentType)); | |
} | |
DocumentContent = Enum.GetNames(typeof(DocumentContent)); |
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 IntegrationTestConvention : Convention | |
{ | |
public IntegrationTestConvention() | |
{ | |
Classes | |
.NameEndsWith("Tests"); | |
Methods | |
.Where(method => method.IsVoid() || method.IsAsync()); |
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
git branch | %{ git checkout $_.Trim().Replace("* ","");git pull} |
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
cinst 1password | |
cinst 7zip | |
cinst 7zip.install | |
cinst adobereader | |
cinst autohotkey.portable | |
cinst beyondcompare | |
cinst DotNet4.5.1 | |
cinst fiddler4 | |
cinst WindowsLiveWriter | |
cinst githubforwindows |
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
{ | |
WindowsFeaturesInstalled: ["IIS-WebServerRole",""] | |
WindowsFeaturesRemoved: ["",""] | |
ChocolateyPakagesInstall: ["git","chrome"] | |
ChocolateyPakagesRemoved: ["",""] | |
CertificatesInstall: ["",""] | |
CertificateRemoved: ["",""] | |
PowershellScripts:[ "configuremachine.ps1;install-agent" ] | |
} |
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
void Main() | |
{ | |
do{ | |
try{ | |
var context=new QsContext(); | |
var connection=context.Database.Connection as SqlConnection; | |
List<dynamic> results= new List<dynamic>(); | |
SqlCommand command = new SqlCommand("SELECT top 1 * FROM sys.dm_db_resource_stats order by end_Time desc",connection); |