Thank you jeev the man omar has just posted the solution to my question and i am sharing it here but its not the exact same thing which i wanted he says that i have to run this scripts externally from the powershell shell to compress files inside my website folder and than copy them to production
Here is what Omar Al Zabir said:
Install powershell and run powershell
Go to you website folder within powershell console
Run the scripts
It will compress all the pictures inside your website folder
Now you can copy those compressed files to your production environment.