Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ikiru Yoshizaki guitarrapc

:octocat:
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
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
{
param
(
[PSCredential]
$credential
)
node $AllNodes.NodeName
View Get-GoogleOAuth.ps1
# Get API Access https://console.developers.google.com/project/projectID/apiui/api?authuser=0
$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
guitarrapc / Get-HostEntryAsync.ps1
Last active Aug 29, 2015
Resolve HostName to IPAddress / IPAddress to HostName
View Get-HostEntryAsync.ps1
#Requires -Version 3.0
<#
.Synopsis
Get HostName to IPAddress Entry / IPAddress to HostName Entry
.DESCRIPTION
using Dns.GetHostEntryAsync Method.
You can skip Exception for none exist HostNameOrAddress result by adding -SkipException $true
@guitarrapc
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 Readme_J.md | 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
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 https://support.microsoft.com/kb/2982791"
$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
{
[CmdletBinding()]
param
(
[parameter(Mandatory = 1, Position = 0, ValueFromPipeline = 1, ValueFromPipelineByPropertyName =1)]
[alias('PSParentPath')]
[string]$Path,
[parameter(Mandatory = 1, Position = 1, ValueFromPipelineByPropertyName =1)]
View New-ZipPairs.ps1
function New-ZipPairs
{
[CmdletBinding()]
param
(
[parameter(
Mandatory = 1,
Position = 0,
ValueFromPipelineByPropertyName = 1)]
$key,
View New-Zip.ps1
function New-Zip
{
[CmdletBinding()]
param
(
[parameter(
Mandatory = 0,
Position = 0,
ValueFromPipeline = 1,
ValueFromPipelineByPropertyName = 1)]
@guitarrapc
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;
}
"@
try
You can’t perform that action at this time.