Skip to content

Instantly share code, notes, and snippets.

View mkht's full-sized avatar

mkht

  • Japan
  • 02:36 (UTC +09:00)
View GitHub Profile
@stknohg
stknohg / GitHub-GraphQLAPISample.ps1
Created April 26, 2018 06:37
GitHub GraphQL APIのサンプル
#
# PowerShell/PowerShellリポジトリのリリース情報を取得するクエリ
# 取得件数は適当
#
$header = @{
'content-type' = 'application/json';
Authorization = 'bearer YOUR_GITHUB_API_TOKEN'
}
$query = @'
{
@aduzsardi
aduzsardi / dhcp_119_dns.ps1
Created July 25, 2017 07:51
generate dhcp option 119 (DNS Search Suffix) powershell script
# ----------------------------------------------------------------------------------------------------------
# PURPOSE: Creates a byte array for use with DHCP Option 119
#
# VERSION DATE USER DETAILS
# 1 07/03/2016 Craig Tolley First version
# 1.1 08/03/2016 Craig Tolley Fixed issue where if the whole domain matched the pointer was incorrect
# 1.2 08/03/2017 Craig Tolley Fixed further issues where the whole domain was matched the pointers are incorrect
# Modified outputs and tidied some formatting
# Convert-StringToOpt119Hex option fixed to not return values for null/empty strings
#
@stknohg
stknohg / Write-BOMlessUTF8Sample.ps1
Last active February 3, 2023 02:05
PowerShellでBOM無しUTF8を書くサンプル
# 例1
"書き込み内容" `
| % { [Text.Encoding]::UTF8.GetBytes($_) } `
| Set-Content -Path ".\BOMlessUTF8.txt" -Encoding Byte
# 例2
Get-Content -Path ".\Source.txt" -Raw -Encoding Default `
| % { [Text.Encoding]::UTF8.GetBytes($_) } `
| Set-Content -Path ".\BOMlessUTF8.txt" -Encoding Byte