windows - Using Powershell FileSystemWatcher on iSeries share -
i'm using following powershell script monitor new files coming in ibm iseries shared folder.
# variables #$folder = "\\10.10.0.120\transform\be\form" #$folder = "c:\users\administrator.ali\desktop\as400" #$folder = "\\nb091002\temp" $folder = "i:\" $filter = "*.txt" $aswform = "c:\aswform\aswform.exe" $watcher = new-object system.io.filesystemwatcher $watcher.path = $folder $watcher.includesubdirectories = $true $watcher.enableraisingevents = $false $watcher.notifyfilter = [system.io.notifyfilters]::lastwrite -bor [system.io.notifyfilters]::filename while($true){ $result = $watcher.waitforchanged([system.io.watcherchangetypes]::changed -bor [system.io.watcherchangetypes]::renamed -bor [system.io.watcherchangetypes]::created, 2000); if($result.timedout){ continue; } write-host $result.name #$aswform $folder }
this seems work fine on local folders or domain shares.
i've tried mapping iseries shared folder network drive doesn't work.
(10.10.0.120 as400)
i'm pretty sure has credentials....
strange thing can access shared folder within windows perfectly.
does have clues or tips me?
ps: little detail, i'll running script through task sheduler trigger
powershell -noexit -windowstyle hidden -file "c:\aswform\watcher.ps1"
but first need working when running script manually!
i have not been able filesystemwatcher work unless target directory windows ntfs drive. if specify drive letter of mapped directory get
exception setting "path": "the directory name w:\ invalid."
if use unc
exception calling "waitforchanged" "2" argument(s): "error reading \\\\path.to.my.ibm.i\\root\ directory."
against novell file server directory name invalid if use drive letter. if use unc against novell drive run, doesn't detect changes file system. works fine against local drive , against windows file server on network.
Comments
Post a Comment