hyperlink - I need to create a script that will check a files size, warn user, move files and link to new location -


we trying keep little end-user data on our companies thin-clients, need create script run when file saved locally. i'm new power shell apologize lack of knowledge.

check file size

if (file size equal or greater "x"mb) output warning "file larger allowed, moving file cloud drive (usually k: drive)

i'd imaging i'd use move-item -destination "k:\my documents\"

create link or shortcut new file location.

i'm sure need more data @ point. take any/all can get.

$directory = get-childitem "d:\download" #directory care $sizelimit = "200000" #size limit in bytes  foreach ($file in $directory) { if ($file.length -ge $sizelimit) {     # notify user pop-up     # coding said popup      # move file     move-item $file.fullname k:\     mklink.exe k:\$file.name $file.fullname 


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -