Windows バッチスクリプト

+ code
@echo off
:: *****************************************************************************
:: * @file
:: * @author    leo
:: * @version   1.0.0
:: * @brief     {ファイルの概要}
:: * @details   {ファイルの詳細説明}
:: *****************************************************************************

:: *****************************************************************************
:: * @fn
:: * @brief     {関数の概要}
:: * @details   {関数の詳細}
:: * @param[in] {arg name1}     {arg detail}
:: * @param[in] {arg name2}     {arg detail}
:: * @return    {戻り値の説明}
:: * @retval    {return value}  {return value detail}
:: * @retval    {return value}  {return value detail}
:: *****************************************************************************
: function_name
setlocal EnableDelayedExpansion
pushd "%~dp0"
    echo [%~nx0] [start] %date% %time%
    echo [%~nx0] [end] %date% %time%
popd
endlocal
exit /b 0

PowerShell スクリプト

+ code
################################################################################
# @file
# @author   leo
# @version  1.0.0
# @brief    {ファイルの概要}
# @details  {ファイルの詳細}
################################################################################
param($arg1="sample code", $arg2=111)

################################################################################
# @fn
# @brief    {関数の概要}
# @details  {関数の詳細}
# @param    {arg name1}     {arg detail}
# @param    {arg name2}     {arg detail}
# @return   {戻り値の説明}
# @retval   {return value}  {return value detail}
# @retval   {return value}  {return value detail}
################################################################################
function Foo ($sample) {
    echo $sample
    return
}

################################################################################
# @fn
# @brief    main
# @details  {関数の詳細}
# @param    {arg name1}     {arg detail}
# @param    {arg name2}     {arg detail}
# @return   {戻り値の説明}
# @retval   {return value}  {return value detail}
# @retval   {return value}  {return value detail}
################################################################################
pushd (Split-Path $MyInvocation.MyCommand.Definition -Parent)
$script_name = $MyInvocation.MyCommand.Name
    $time = (Get-Date -Format "yyyy/MM/dd HH:mm:ss")
    echo "[$script_name] [start] $time"

    Foo sample
    echo aaa

    $time = (Get-Date -Format "yyyy/MM/dd HH:mm:ss")
    echo "[$script_name] [end] $time"
popd
return

最終更新:2013年11月09日 14:51