Author: dreimer Date: Wed Oct 21 03:58:19 2009 New Revision: 43662
URL: http://svn.reactos.org/svn/reactos?rev=43662&view=rev Log: Eh, did ever anyone realize that the flash tool is not PS compatible? Fixed this with a nice dll invoke function by Joel Bennett aka jaykul from #powershell
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] Wed Oct 21 03:58:19 2009 @@ -71,5 +71,5 @@ }
# Highlight the fact that building has ended. -"$_ROSBE_BASEDIR\Tools\flash.exe" +FlashWindow (ps -id $pid).MainWIndowHandle $true $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] Wed Oct 21 03:58:19 2009 @@ -60,6 +60,26 @@ $ENV:CPLUS_INCLUDE_PATH = $null $ENV:LIBRARY_PATH = $null
+# Flash Tool in a Function. + +function New-PInvoke { + param( + $Library, + $Signature + ) + $local:ErrorActionPreference = "SilentlyContinue" + $name = $($signature -replace "^.*?\s(\w+)(.*$",'$1') + $MemberDefinition = "[DllImport(`"$Library`")]`n$Signature" + + $type = Add-Type -PassThru -Name "PInvoke$(Get-Random)" -MemberDefinition $MemberDefinition + $null = iex "New-Item Function:Global:$name -Value { [$($type.FullName)]::$name.Invoke( `$args ) }" + $local:ErrorActionPreference = "Continue" +} + +New-PInvoke user32.dll "public static extern void FlashWindow(IntPtr hwnd, bool bInvert);" + +# Web Downloader in a function. + function global:Get-WebFile { param( $url = $null,