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)] | |
$filePath | |
) | |
$accountsFilter= "" | |
Get-Content -Path $filePath | ForEach-Object { | |
if($_.Trim()){ | |
$accountsFilter += "(sAMAccountName=$_)" |
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 Spy-Cmdlet { | |
param( | |
[Management.Automation.CommandInfo]$command | |
) | |
if ($input) { | |
trap { $_; break } | |
$command = $input | select -first 1 | |
} | |
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
[CmdletBinding()] | |
param() | |
Function Get-RegistryKeyPropertiesAndValues | |
{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$path | |
) |
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="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" /> | |
<!-- This will allow the config file to be copied to any project referencing the project that need the config transformation --> | |
<PropertyGroup> | |
<AllowedReferenceRelatedFileExtensions> | |
$(AllowedReferenceRelatedFileExtensions); | |
.dll.config | |
</AllowedReferenceRelatedFileExtensions> |
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
-- Detect | |
sp_change_users_login 'report' | |
-- Repair | |
SELECT 'EXEC sp_change_users_login ''Update_One'', '''+[name]+''', '''+[name]+'''' | |
FROM sys.database_principals WHERE | |
type_desc='SQL_USER' | |
and NAME NOT IN ('dbo','guest','INFORMATION_SCHEMA','sys') |
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 Odbccp32 | |
{ | |
/// <summary> | |
/// From sql.h | |
/// </summary> | |
private const int SQL_MAX_MESSAGE_LENGTH = 512; | |
[DllImport(nameof(Odbccp32), CharSet = CharSet.Unicode, SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool SQLGetInstalledDrivers(char[] lpszBuf, ushort cbufMax, out ushort pcbBufOut); |
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 Odbccp32 | |
{ | |
/// <summary> | |
/// From sql.h | |
/// </summary> | |
private const int SQL_MAX_MESSAGE_LENGTH = 512; | |
[DllImport(nameof(Odbccp32), CharSet = CharSet.Unicode, SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool SQLGetInstalledDrivers(char[] lpszBuf, ushort cbufMax, out ushort pcbBufOut); |
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
[CmdletBinding()] | |
param( | |
[switch]$force | |
) | |
$userProfileDir = $env:USERPROFILE | |
$NodeDir = Join-Path $userProfileDir "Node" | |
if($force -and (Test-Path $NodeDir)){ |
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
##----------------------------------------------------------------------- | |
## <copyright file="ApplyVersionToAssemblies.ps1">(c) Microsoft Corporation. This source is subject to the Microsoft Permissive License. See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. All other rights reserved.</copyright> | |
##----------------------------------------------------------------------- | |
# Look for a 0.0.0.0 pattern in the build number. | |
# If found use it to version the assemblies. | |
# | |
# For example, if the 'Build number format' build process parameter | |
# $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) | |
# then your build numbers come out like this: | |
# "Build HelloWorld_2013.07.19.1" |
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
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Windows.Input; | |
using static PInvoke.User32; | |
using static PInvoke.Kernel32; | |
namespace WpfApplication1 | |
{ |