S
Sanjeev Reddy
Guest
Hello Didier, With some googling I’m able to create a PowerShell script which monitors a workspace and then copies “.propath” file into new Project each time. Below is the script: ### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO $watcher = New-Object System.IO.FileSystemWatcher $watcher.Path = "C:\workspaces\117\Random2" #workspace location to monitor $watcher.Filter = "*.*" $watcher.IncludeSubdirectories = $false $watcher.EnableRaisingEvents = $true ### DEFINE ACTIONS AFTER AN EVENT IS DETECTED $action = { $path = $Event.SourceEventArgs.FullPath $source = "C:\workspaces\117\Random2\.propath" #location of .propath file that needs to copied to other projects $logline = "$(Get-Date), $source, $path" Add-content "C:\log.txt" -value $logline Copy-Item -Path $source -Destination $path } ### DECIDE WHICH EVENTS SHOULD BE WATCHED Register-ObjectEvent $watcher "Created" -Action $action while ($true) {sleep 5} Hope this helps, Sanjeev
Continue reading...
Continue reading...