- 输出
echo "hello word"
- 输出到文件
echo "hello" > test.txt //覆盖
echo "word" >> test.txt //追加
- 判断SVN进程是否在运行,如果在运行,杀死进程
$Running = Get-Process svn.exe -ErrorAction SilentlyContinue
if($Running -eq $null)
{
echo "svn not run"
}else
{
taskkill /F /IM svn.exe /T
}
- 判断文件或文件夹是否存在
$isApk = (Test-Path ".svn")
if("$isApk" -eq "False")
{
echo "checkout"
}
- 删除文件
$filepath= "E:\Temp\test.ps1"
Remove-Item $filepath
- 删除文件夹及内容
$dirpath = "E:\Temp"
Remove-Item $dirpath -recurse
网友评论