The following might help -
$Button1 = Get-ChildItem -Path 'SomePath\SomeFile' | Out-GridView -OutputMode Single -PassThru -Title 'SomeTitle' | ForEach-Object { $_.name }
if ($button -eq 'pause') {
$button = 'resume'
}
Write-Host "Button text is now $button"