SHOW:
|
|
- or go back to the newest paste.
1 | Unregister-Event -SourceIdentifier MyNewEmailAlert | |
2 | $ol = New-Object -ComObject Outlook.Application | |
3 | $Action = { | |
4 | - | $path ="A:\New Folder" |
4 | + | $path ="A:\New Folder" |
5 | - | if(Test-Path $path){ |
5 | + | if(Test-Path $path){ |
6 | - | Remove-Item -Path $path |
6 | + | Remove-Item -Path $path |
7 | } | |
8 | New-Item -Path $path -ItemType Directory | |
9 | } | |
10 | $null = Register-ObjectEvent $ol NewMailEx -SourceIdentifier MyNewEmailAlert -Action $Action |