Questions tagged [wpk]

7 questions
4
votes
2 answers

PowerShell and Single Threaded Apartment

I have developed a small GUI tool in PowerShell using WPK. I have the following start up command powershell -ExecutionPolicy Unrestricted -file PowerTools.ps1 -noexit -sta I am getting the following error. New-Object : Exception calling ".ctor"…
lingo_journey
  • 653
  • 1
  • 8
  • 22
2
votes
1 answer

Problem with WPK when using PowerShell with .NET4

The following code works, when I do not use .NET 4.0 Framwork ipmo WPK $ConnectionString = $ConnectionString = "Server=localhost;Integrated Security=True" $conn = new-object System.Data.SQLClient.SQLConnection $conn.ConnectionString =…
bernd_k
  • 11,558
  • 7
  • 45
  • 64
1
vote
1 answer

Why makes this return at the end of a PowerShell script a difference?

3rd Edit: The only difference between the following two scripts (besides the name of the function) is the fact, that the second doesn't return the result via explicit return. But they behave different. The first shows the two rows abc efg in the…
bernd_k
  • 11,558
  • 7
  • 45
  • 64
1
vote
0 answers

How to display this WPF ListView with a vertical toolbar?

I'm using PowerShell and the WPK toolkit the following New-ListView -Name TableView -View { New-GridView -AllowsColumnReorder -Columns { New-GridViewColumn "title" New-GridViewColumn "dateAdded" New-GridViewColumn "url" …
bernd_k
  • 11,558
  • 7
  • 45
  • 64
0
votes
1 answer

Why does not work WPK DataBinding in PowerShell with TextBox "Text" property?

Good day. I'd like to ask a question. Why TextBox control "Txt" in this code does not receive a property value of $CounterObject object? New-Grid -Height 150 -Width 200 -Rows 3 { New-Label -Name InfoLabel -Row 0 "Some message" New-TextBox…
0
votes
1 answer

How can I add sorting by clicking on the column header in this GridView?

ipmo WPK $ConnectionString = $ConnectionString = "Server=localhost;Integrated Security=True" $conn = new-object System.Data.SQLClient.SQLConnection $conn.ConnectionString = $ConnectionString $conn.Open() function Invoke-sql1 { param(…
bernd_k
  • 11,558
  • 7
  • 45
  • 64
0
votes
1 answer

New-TextBlock hidden password with wpk module on powershell

I am extremely new to PowerShell tool making so forgive my ignorance. I imported the WPK module and am trying to create a box with multiple fields. One of those fields is a password field but it shows the password as it's being typed. I am unsure of…
user2561924
  • 47
  • 2
  • 6