Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# https://amd-osx.com/forum/viewtopic.php?t=413
ls -AFG /Volumes/
#VOLUME_NAME='Install OS X El Capitan'
VOLUME_NAME='Image Volume'
DOWNLOAD_PATH="/Volumes/$VOLUME_NAME/Downloads"
FONTS_PATH="/Volumes/$VOLUME_NAME/System/Library/Fonts"
ls -FG "/Volumes/$VOLUME_NAME/"
# https://qiita.com/acuo/items/9928e1fbb31b238d9705#%E4%BB%8A%E5%9B%9E%E4%BD%BF%E3%81%A3%E3%81%9F%E3%82%B3%E3%83%BC%E3%83%89%E5%85%A8%E3%81%A6
function Test($Scripts, $N) {
# 各スクリプトの並びをシャッフルしてN回試行しその平均タイムを取得
$Scripts * $N | Sort-Object { Get-random } |
Select-Object Name, @{ name = "Time"; expression = { (Measure-Command $_.Script).TotalMilliseconds } } |
Group-Object Name |
Select-Object Name, @{ name = "AverageTime"; expression = { ($_.Group | Measure-Object Time -Average).Average } } |
Sort-Object AverageTime |
Format-Table Name, @{ label = "AverageTime(msec)"; expression = { $_.AverageTime -as "int" } } -AutoSize
# ホスト要件 # https://docs.ansible.com/ansible/2.9_ja/user_guide/windows_setup.html#id1
# Windows version
Get-WmiObject Win32_OperatingSystem
# PowerShell 3.0+ supported
$PSVersionTable
# .NET 4.0+ supported
# https://stackoverflow.com/a/3495491