Script fixes

! made script working on another version of PowerShell
* refactoring of some functions
Fixed copying and symlink creation

! fixed symlinking (cygwin instead of mingw version)
! fixed copying (?) - detecting failed copy