Skip to content

Instantly share code, notes, and snippets.


Ikiru Yoshizaki guitarrapc

Block or report user

Report or block guitarrapc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
guitarrapc / DSCPushSample.ps1
Last active Aug 29, 2015
DSC Push model Sample for AD Memeber (DSC Sever) to WorkGroup Servers (30 servers). Speed comparison with DSC and Valentia.
View DSCPushSample.ps1
# DSC Push のサンプルとして、サーバー30台に対する DSC-Service のWindows 機能インストールを行う
configuration InstallDSCServiceCredential
node $AllNodes.NodeName
View Get-GoogleOAuth.ps1
# Get API Access
$clientId = "INPUT CLIENT ID for API"
$clientSecret = "CLIENT SECRET for API"
#return to us locally not via a web server
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$grantType = "authorization_code"
# change scope here, you can use oauth playground to find scopes
guitarrapc / Get-HostEntryAsync.ps1
Last active Aug 29, 2015
Resolve HostName to IPAddress / IPAddress to HostName
View Get-HostEntryAsync.ps1
#Requires -Version 3.0
Get HostName to IPAddress Entry / IPAddress to HostName Entry
using Dns.GetHostEntryAsync Method.
You can skip Exception for none exist HostNameOrAddress result by adding -SkipException $true
guitarrapc / Copy-StrictedFilterFileWithDirectoryStructure.ps1
Last active Aug 29, 2015
Copy Selected Extensions, and Directory Structure Only
View Copy-StrictedFilterFileWithDirectoryStructure.ps1
# Copy "All Directory Structure" and "File" which Extension type is .bat
Copy d:\GitHub\valentia -Destination d:\fuga -Force -Recurse -Filter "*.bat"
# Copy "All Directory Structure" and "File" which Extension type is .md
Copy d:\GitHub\valentia -Destination d:\fuga -Force -Recurse -Filter "*.md"
# If you want to exclude specific file to copy
Get-ChildItem -Path $Destination -Recurse -File | where Name -in | Remove-Item -Recurse
View UseLayoutRounding.psm1
# Install (simple way)
# Write this code to "%USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1"
# Install (module way)
# Place this script to "%USERPROFILE\Documents\WindowsPowerShell\Modules\UseLayoutRounding\UseLayoutRounding.psm1" and
# write "Import-Module UseLayoutRounding" to Microsoft.PowerShellISE_profile.ps1
Add-Type -TypeDefinition @"
using System;
using System.Collections.Generic;
using System.Reflection;
guitarrapc / MS14-045CheckPipeline.ps1
Last active Aug 29, 2015
MS14-045 issue check by piepline.
View MS14-045CheckPipeline.ps1
$message = "font '{0}' found! Your environmet will trouble with MS14-045. See"
$fontregistory = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\'
(Get-Item -Path $fontregistory).Property | % {(Get-ItemProperty -path $fontregistory).$_ | where {$_.EndsWith('.otf')} | where {Test-Path $_} | %{ Write-Host ($message -f $_) -ForegroundColor Red;return}}
Write-Host 'Your environment is OK.'
View Copy-ItemEX.ps1
function Copy-ItemEX
[parameter(Mandatory = 1, Position = 0, ValueFromPipeline = 1, ValueFromPipelineByPropertyName =1)]
[parameter(Mandatory = 1, Position = 1, ValueFromPipelineByPropertyName =1)]
View New-ZipPairs.ps1
function New-ZipPairs
Mandatory = 1,
Position = 0,
ValueFromPipelineByPropertyName = 1)]
View New-Zip.ps1
function New-Zip
Mandatory = 0,
Position = 0,
ValueFromPipeline = 1,
ValueFromPipelineByPropertyName = 1)]
guitarrapc / New-Empty.ps1
Created Aug 20, 2014
LINQ Enumerable.Empty in PowerShell
View New-Empty.ps1
function New-Empty ([string]$type)
$def = @"
public static System.Collections.Generic.IEnumerable<$type> Empty()
System.Collections.Generic.IEnumerable<$type> empty = System.Linq.Enumerable.Empty<$type>();
return empty;
You can’t perform that action at this time.