以下のようなユーザからの入力 (JSON payload) があったとき...
{
"parameterA": "Enable",
"parameterB": "Disable",
...
}
function Get-ProcessList() | |
{ | |
$ret = @() | |
function Simplify-ProcessInformation ([System.Diagnostics.Process]$process) | |
{ | |
$ret = @{} | |
$ret["Id"] = $process.Id; | |
$ret["ProcessName"] = $process.ProcessName; | |
$ret["MainWindowTitle"] = $process.MainWindowTitle |
Write-Host "Press any key to continue ..." -NoNewLine | |
[Console]::ReadKey() | Out-Null | |
[string]::Empty |
using System; | |
using System.Runtime.InteropServices; | |
public class ActiveWindowRectGetter | |
{ | |
[DllImport("user32.all")] | |
public static extern bool GetWindowRect(IntPtr hWnd, out WindowRectRaw lpRect); | |
[DllImport("user32.dll")] | |
public static extern IntPtr GetForegroundWindow(); |
param([int]$Minutes = 3) | |
$appName = "Wait-Noodles" | |
# create a task tray icon | |
Add-Type -AssemblyName System.Windows.Forms | |
$notifyIcon = New-Object System.Windows.Forms.NotifyIcon | |
# get an icon image from powershell.exe | |
$psExeFilePath = Join-Path $Script:PSHOME "powershell.exe" |
param([string]$UserName = "__your_username__", | |
[string]$Password = "__your_password__") | |
$computerName = hostname | |
$user = [ADSI]"WinNT://$computerName/$UserName,User" | |
$user.ChangePassword($Password, $Password) |
var http = require('http'); | |
var express = require('express'); | |
var routes = require('./routes'); | |
var app = express(); | |
var server = http.createServer(app); | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(express.static(__dirname + '/public')); |
Add-Type -AssemblyName System.Windows.Forms | |
$clipText = [Windows.Forms.Clipboard]::GetText() | |
if ($clipText.Contains('/')) | |
{ | |
$replacedClipText = $clipText -replace '/', '\' | |
[Windows.Forms.Clipboard]::SetText($replacedClipText) | |
} | |
elseif ($clipText.Contains('\')) | |
{ | |
$replacedClipText = $clipText -replace '\\', '/' |
# set window title | |
(Get-Host).UI.RawUI.WindowTitle = $MyInvocation.MyCommand | |
# get text from the clipboard | |
Add-Type -AssemblyName System.Windows.Forms | |
$clipText = [Windows.Forms.Clipboard]::GetText() | |
Write-Host $clipText | |
while ($true) |
param( | |
[Parameter(Mandatory = $true)] | |
[string] | |
$SourceImageFilePath | |
) | |
# 画像ファイルのパスを解決 | |
$resolvedFilePath = Resolve-Path $SourceImageFilePath | |
# 画像の情報を取得 |