15,743,609 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by picasso2 (Top 4 by date)
picasso2
17-Sep-17 13:46pm
View
Many thanks, I placed the code inside a button (to triggered it)
using (PowerShell PowerShellInstance = PowerShell.Create())
{
PowerShellInstance.AddScript("Test-Dtc -LocalComputerName param($param1) -RemoteComputerName param($param2) -Verbose");
var localComputer = Environment.GetEnvironmentVariable("MyLocalPC");
PowerShellInstance.AddParameter("param1", localComputer);
MessageBox.Show("variable remotecomputer");
var remoteComputer = "MyRemoteSrv";
PowerShellInstance.AddParameter("param2", remoteComputer);
Collection<psobject> PSOutput = PowerShellInstance.Invoke();
MessageBox.Show("start loop");
foreach (PSObject outputItem in PSOutput)
{
MessageBox.Show("inside the foreach loop");
if (outputItem != null)
{
MessageBox.Show(outputItem.BaseObject.ToString());
}
else
{
MessageBox.Show(outputItem.BaseObject.ToString());
}
}
}
Nothing is output so I added few MessageBoxs . I noticed that message "start loop" is executed but NO code inside the foreach loop is ever gets executed.
picasso2
17-Feb-15 23:38pm
View
both your code and my code result in same output
msiexec /a "C:\Temp\MyApplication.msi" /qb TARGETDIR="C:\Temp\MyApplication.msi"
this will not run but if I copy to a batch file and then run , works fine.
-The destination folder is the same name as the msi that is why I added an EXT (extracted)to define is a extracted folder
-No the folder does not exist in the target
-path is complete and correct as you can see by the output
I will try to create the folder target first now
picasso2
21-Aug-14 0:17am
View
I tried to use the same code as ChauhanAjay recommended below. but the property BeginInit()/EndInit() cannot be found.
Image imgPhoto = new Image();
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri("c:\\Temp\test.jpg");
bitmap.EndInit();
imgPhoto.Source = bitmap;
picasso2
20-Aug-14 22:30pm
View
The path is correct, somehow the “\” dropped when trying to format the post.
In any case,
The program compiles without errors.
If I add other controls (text, button) , just to test it
TextBlock printTextBlock = new TextBlock();
printTextBlock.Text = "Demo Text";
stackPanel1.Children.Add(printTextBlock);
Button btn = new Button();
btn.Content = "Dynamic Button";
stackPanel1.Children.Add(btn);
it works fine but trying to add an image to either the stackpanel or Image controls
Image imgPhoto = new Image();
imgPhoto.Source = new BitmapImage(new Uri("c:\\Temp\\test.jpg"));
stackPanel1.Children.Add(imgPhoto);
No image is displayed in either control. The image is a 300x300
And thus the reason asking for help
Thank you
~P