Enter file contents here## create database
@{ q = "create database mydb" } | Invoke-WebRequest -Method Get -Uri "http://localhost:8086/query"
function InvokePowerShellCommand | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter()] | |
[ValidateNotNullOrEmpty()] | |
[string]$Command | |
) | |
program InterfaceTestDriver; | |
{$APPTYPE CONSOLE} | |
uses | |
SysUtils; | |
type | |
IMyIntf = interface | |
['{D9075E8D-417D-4358-ABA0-6688B245EF6A}'] |
$categories = @( | |
[PSCustomObject]@{Name='Menu'; Description='メニュー関連の項目'} | |
[PSCustomObject]@{Name='User'; Description='ユーザーフォルダー関連の項目'} | |
[PSCustomObject]@{Name='Public'; Description='パブリックフォルダー関連の項目'} | |
[PSCustomObject]@{Name='Library'; Description='ライブラリフォルダー関連の項目'} | |
[PSCustomObject]@{Name='System'; Description='システム関連の項目'} | |
) | |
$menuCommands = @( |
select | |
(case when exists ( | |
select * from T where a = A | |
) then 1 else 0 end) | |
from dual; |
$re = [regex]"#(?<cp>\d+)|'(?<chars>.+?)'" | |
function ConvertFrom-Codepoint { | |
[CmdletBinding()] | |
param ( | |
[string]$Source | |
) | |
$matches = $re.Matches($Source).Groups | ?{ $_.Success -and ($_.Name -in ('cp', 'chars')) } | |
$s = "I have a pen. I have a apple. oh!! Apple pen! I have a pen. I have a pineapple. oh!! Pineapple pen! Apple pen. Pineapplepen. Pen pineapple apple pen." | |
$s -split(' ') | ?{ $_ -match "(\w+)[^.!]?" } | %{ $matches[1] } | group | select -Property Name,CountName | |
# Name Count | |
# ---- ----- | |
# I 4 | |
# have 4 | |
# a 4 | |
# pen 7 | |
# apple 4 |
function BoilerplateFunction { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[IO.FileInfo[]]$files | |
) | |
begin { | |
$xls = New-Object -ComObject Excel.Application | |
$xls.Visible = $false | |
$xls.DisplayAlerts = $false |
$root = "HKCU:\Software\Borland\Delphi\7.0" | |
$rootDir = (ls $root\.. -Include "7.0" -Recurse).GetValue("RootDir") | |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
function Update-DccLib { | |
$reg = ls $root -Include "Environment Variables" -Recurse | select -First 1 | |
$envVars = @{ '$(DELPHI)' = $rootDir } | |
$reg.Property | %{ $envVars.Add([string]::Format('$({0})',$_), $reg.Getvalue($_)) } |
New-Process (Resolve-Path .\usr\bin\influxd.exe) "-config $(Resolve-Path .\etc\influxdb\influxdb.conf)" | | |
Enable-TextLog -RedirectStandardError access_log -Verbose | | |
Launch-Process | |
New-Process (Resolve-Path .\usr\bin\influxd.exe) "-config $(Resolve-Path .\etc\influxdb\influxdb.conf)" | | |
Enable-EventLog -RedirectStandardError Access -Verbose | | |
Launch-Process |