Use Add-Type
command:
PS C:\> Add-Type -Path .\File1.cs, .\File2.cs -ReferencedAssemblies System.Core, System.Drawing
Use Add-Type
command:
PS C:\> Add-Type -Path .\File1.cs, .\File2.cs -ReferencedAssemblies System.Core, System.Drawing
Add-Type -AssemblyName System.Drawing, System.Windows.Forms | |
# Bitmap と Graphics オブジェクトを用意しておく (1x1 ピクセル) | |
$bitmap = New-Object System.Drawing.Bitmap(1, 1) | |
$graphics = [System.Drawing.Graphics]::FromImage($bitmap) | |
# 3 秒間の猶予を与える | |
Write-Host "Move the cursor to the targt position in 3 seconds..." | |
Start-Sleep 3 |
$bars = @('|', '/', '-') | |
while ($true) | |
{ | |
[Console]::CursorVisible = $false | |
foreach ($bar in $bars) | |
{ | |
[Console]::Write("Processing... {0}", $bar); | |
[Console]::SetCursorPosition(0, [Console]::CursorTop) | |
Start-Sleep -Milliseconds 150 | |
} |
@echo off | |
if "%~1" == "" (echo Please specify the target file path. & pause & exit) | |
set PS_FILE_PATH=%~dpn0.ps1 | |
set TARGET_FILE_PATH=%~1 | |
PowerShell -Sta -File "%PS_FILE_PATH" -TargetFilePath "%TARGET_FILE_PATH%" |
@echo off | |
if "%~1" == "" echo Please specify the file path. & pause & exit | |
set PS_FILE_PATH=%~dpn0.ps1 | |
set TARGET_FILE_PATH=%~1 | |
PowerShell -Sta -File "%PS_FILE_PATH%" -TargetFilePath "%TARGET_FILE_PATH%" |
(Get-ChildItem Env:Path).Value.Split(';') |
FROM ubuntu:16.04 | |
# Install sshd | |
RUN apt-get update | |
RUN apt-get install -y openssh-server | |
# Modify `sshd_config` | |
RUN sed -ri 's/PermitEmptyPasswords no/PermitEmptyPasswords yes/' /etc/ssh/sshd_config | |
RUN sed -ri 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
RUN sed -ri 's/^UsePAM yes/UsePAM no/' /etc/ssh/sshd_config |
[Windows.Forms.Clipboard]::SetText([Guid]::NewGuid().Guid) |
dict = """ | |
a, i, u, e, o, | |
ka, ki, ku, ke, ko, | |
sa, si, su, se, so, | |
ta, tsu, te, to, | |
na, ni, nu, ne, no, | |
ha, hi, hu, he, ho, | |
ma, mi, mu, me, mo, | |
ya, yu, yo, | |
ra, ri, ru, re, ro, |
echo | set /p CLIP_STRING="foobar" | clip |