$data = [String]::Join("`r`n", (Get-Content "vbsファイルパス"))
$ctrl = New-Object -ComObject "ScriptControl"
$ctrl.Language = "VBScript"
$ctrl.AddCode($data)
$vbs = $ctrl.CodeObject
set-variable -name TEISU -value "定数です" -scope script -option constant write-host $TEISU # "定数です"と表示
private boolean isEmpty(final String obj) {
return obj == null || obj.length() == 0;
}
Stringの空文字チェックをします。
trueなら空。falseなら何か文字列が入っています。
import os
dir_path = "/home/test/testdir/"
if not os.path.isdir(dir_path):
os.mkdir(dir_path)