[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Add-Type -TypeDefinition @'
using System.Windows.Forms;
using System.Drawing;
public class A{
public static Point getPos(){
return Cursor.Position;
}
}
'@ -ReferencedAssemblies 'System.Windows.Forms.dll','System.Drawing.dll'
[A]::getPos()
IsEmpty X Y
------- - -
False 1112 316
return $MessageWithDate
в function Write-Log process
$a = (B -message "World" -Verbose 4>&1 | Write-Log -LogFilePath "c:\temp\test.log" ) ; $a
[Function B] - Start
Initial parameters:
- message = 'World'
- Verbose = 'True'
Hello, World
[Function B] - End
3/30/2019 12:37:35 PM [Function B] - Start
3/30/2019 12:37:35 PM Initial parameters:
3/30/2019 12:37:35 PM - message = 'World'
3/30/2019 12:37:35 PM - Verbose = 'True'
3/30/2019 12:37:35 PM Hello, World
3/30/2019 12:37:35 PM [Function B] - End
pushd HKLM:
cd System\Classes
[Microsoft.Win32.RegistryKey]$x = get-childitem | where-object { $_.name -match '\*' }