![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PowerShell
灰帽DBA
这个作者很懒,什么都没留下…
展开
-
powershell提取日志内容
写了一个powershell提取日志内容的脚本,搜索oracle关于ORA的报错信息 #查找结果赋值 $d=Get-ChildItem c:\test -Recurse | where{"script.txt"} #判断文件是否存在,若不存在返回3 if ($d -eq $null ) { write-host " ALERT FILE NO FOUND"原创 2012-02-13 10:13:54 · 3493 阅读 · 0 评论 -
powershell_读取ORA错误脚本
#过滤oracle警告日志文件ORA-错误 $c=Get-Content C:\script.txt | select-string -pattern "ora-" #判断ORA-错误存在条件 #若$c返回值为null,则输出1返回值结束循环 if ( $c -eq $null ) { write-host "STATE_OK" $STAT原创 2012-01-13 13:00:45 · 1271 阅读 · 0 评论 -
powershell-无法加载文件,因为在此系统中禁止执行脚本。
写了一个powershell脚本测试脚本,结果执行的时候报错 $a=Get-Content C:\script.txt | select-string -pattern "ora" if ( $a -eq $null ) { write-host "error" } else { write-ho原创 2012-01-12 16:33:12 · 22482 阅读 · 0 评论