I am using Visual Studio to create a GUI environment for all my PowerShell scripts together to create a common platform . I have one problem with the text box . I want to have a text box so all the results appear there . Right now only the last command is appearing there .
Any suggestions ?
<TextBox x:Name="Information" HorizontalAlignment="Left" Margin="10,116,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="3" Height="255" Width="678"/>
and I want at this texbox to appear the following messages
$WPFMapping.Add_Click({
{
$WPFInformation.Text = " We Will try to map the drives"}
if (((New-Object System.IO.DriveInfo("N:")).DriveType -ne
"NoRootDirectory"))
{
$WPFInformation.Text = " N drive is already mounted and accessible"}
else {
net use /persistent:yes N: "this drive"
Write-Host "mounting"}
if (((New-Object System.IO.DriveInfo("V:")).DriveType -ne
"NoRootDirectory"))
{
$WPFInformation.Text = " V drive is already mounted and accessible"}
else {
$WPFInformation.Text = " V drive mapping in progress"}
net use /persistent:yes V: "this drive"
$WPFInformation.Text = " V drive mapping has been completed"
})