Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. Yes, we create a separate process to host our gadgets. JuanC
  2. One more thing, we have done some recent work on our cmdlets (out-chart, out-gauge, out-map) in order to support credentials when refreshing. If you are planning to use -refresh or manually refresh using right-click you will need our current build. We are still doing some tests but we can certainly make it available to anyone interested. Our current build will also prompt for the credentials password once more, this is a little complicated to explain in detail in this thread but we are planning to fix this in future builds. JuanC
  3. I have used a technique discussed in a couple of blogs such as http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!273.entry Generate an encrypted version of your password read-host -assecurestring | convertfrom-securestring| out-file Encrypted.txt Get a secure string $secret = cat Encrypted.txt | convertto-securestring Translate to a "clear-text" representation if needed $Ptr=[system.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($secret) $str=[system.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr) Use $str here Clean-up the clear text string [system.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($ptr) I have not tested the constructor suggested by SapienScripter but if they support a secure string you could pass $secret instead of $str and remove all the Runtime.Interop calls. This would give you more security as the password would always be handled as a secure string. AFAIK, the call to convert the password to a secure string uses DPAPI so it uses some user/machine info. Because of this you probably would have to repeat the read-host part if you want to use this script in multiple computers. JuanC
  4. >> Is it normal behaviour for gadgets on windows XP to be accompanied by a completely blank extra window that when closed, closes all the associated gadgets? We have fixed this bug in our current build, we expect to upload a new build in the next couple of weeks. If you or others want to test it sooner than this we can make it available. >> and also hopefully not show each gadget in the Alt-Tab process list? I suppose that might not be too easy though. We understand that when creating several desktop gadgets, these windows may clutter the UI. One of the things we did to alleviate this is that all floating gadgets will not appear in the task bar. Your suggestion is great as the alt-tab list also gets crowded with gadgets. We have a new parameter tentative called ToolWindow that would hide gadgets from the alt-tab process list. As it is right now you can combine it with floating or you can use it on its own. Although the ToolWindow name may not be intuitive, turning this style seems to be the way to get a window hidden from alt-tab and if you do not use floating, the caption will in fact be the one used for Tool Windows (e.g. toolbars, etc.). We are also considering whether this flag should be automatically used for floating gadgets. Any feedback on this behavior (naming, defaults, etc.) would be greatly appreciated. JuanC
  5. I am assuming that by "exposed the database connection strings" you are talking about the user and password info. When you are using invoke-sql we support 2 scenarios where this information is securely handled a) Using Windows Authentication: by using your windows credentials your PS1 will contain no user information and you will not get any additional prompts. Using the -credential parameter: Support for this feature was added recently and allows you to specify only the user name with the powershell standard credential handling taking care of prompting for the password. Using this approach will result in an additional prompt for a password but will keep your information confidential. Note that we could provide a tool to encrypt the connection string but we feel this will give users a false sense of security. In order to decrypt it on any machine we would have to include the private key in our exe so it would be just a matter of time before somebody exposes it and renders this encryption useless. So if you are coming from the powershell approach we offer 2 secure ways where your password is not compromised. Still there are probably millions of users who stay away from Windows Authentication and reuse a common security credential for all clients. These users can hardcode the password in the PS1 and as long as they keep the PS1 files in a secure location this approach will not expose anything they are not already exposing with the single-credential client app. Note also that if you are running PS1 scripts, Powershell supports digitally signing those strings to protect you from running scripts from an untrusted source but it does not support encrypting the scripts to protect the information in them. To summarize we are trying to strike a balance between security and usability and we are hoping we expose this clearly to our customers, most of what I described here also applies to gadgets created using the PowerGadgets creator. If you have any suggestions on how we can improve please let us know. JuanC
  6. How many points does the chart has at the begining? We have different refresh strategies when we see a chart with multiple points against a chart with just one. Can you please try creating a gadget that contains only the chart, we have fixed some refresh issues in multi-components gadgets so this would let us know if you are experiencing a related problem. If you want to test a newer build please send a message to support at powergadgets dot com and mention this thread, we will be uploading a new build in the next couple of weeks but we can make it available. Regards, JuanC
  7. Jpg looks really bad with line art such as bar/line/area charts so the only reason to support it would be for some app that does not support png or bitmap. We will support it if customers demand it. We appreciate your feedback JuanC
  8. In our current implementation, we are using -credentials and it works with an SMTP server that knows nothing about domains or windows authentication. We even tested an SMTP user named as a windows user but using a totally different password so we think the credentials approach should work with Yahoo SMTP. Also we should be adding SSL support in the next build. Should we still allow the user to supply passwords in the script? We are trying to figure out where to draw the line between ease-of-use and allowing our users to be insecure. Regards, JuanC
  9. We have an implementation that follows your recommendation, it accepts both get-process | send-mail get-process | out-string | send-mail There is an interesting scenario we wanted to share with you, what would you expect is the output of the following command dir *.csv | send-mail a) Is it an email with the text output generated by get-childitem Is it an email that includes the csv as attachments? I am guessing you can say "give me both and a parameter that specifies which method to use" but we want to know which is the behavior you expect to be the default. Obviously if you do "dir *.csv | out-string | send-mail" we will send the output generated by get-childitem as we will not get the real files. JuanC
  10. We thought nobody would care much about this because bmps are not compressed so may not be too suitable for email. I am guessing that you are using a particular email client that does not support png. Our next public build will support the output parameter when sending email (wmf will not be supported at this time, only bmp and png). An addtional advantage of -output is that we will use the file name to name the attachment, e.g. out-chart -output MyChart.bmp | send-mail ... This will send the email including the attachment as a bitmap named MyChart. Note that we will be using a content type of "image/x-windows-bmp", please let us know if you think this content type will not work for you. Regards, JuanC
  11. We are testing adding authentication through the -credentials approach. It works fine but I wonder if the fact that you cannot hardcode the password into a ps1 is a security feature or an annoyance. I have not checked the powershell documentation on credentials too deeply so I wanted to hear what you think e.g. send-mail -to foo@bar.com -subject "Subject test" -credentials MyUser Then you would get the powershell standard credentials prompt. JuanC
  12. I just tested the creator using SQLServer and an IP address and the next button works fine provided I supply a valid database name. I also noticed we are not showing an error when the server or database name are incorrect, if you see a long delay it could be we are trying to connect to the database and failing. We will make sure our next build shows a message to let you know what went wrong. Regards, JuanC
  13. We support arrays in out-chart so you can say 10,20,12 | out-chart Using variables you can also do $a = 10,20,12 $a | out-chart Personally I think that the "creating objects" approach scales better, if you find out you are interested in another "field" you just add another property, also you can use your script for things other than a chart. If you want to show something else in the tooltip you can also do that. JuanC
  14. This is an approach we use in some internal scripts MyData.ps1 $oct = 134 $nov = 345 $dec = 239 $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "October" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $oct Write-output $obj $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "November" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $nov Write-output $obj $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "December" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $dec Write-output $obj In our scenarios, $oct = XXX is actually something like $oct = invoke-sql or more complex code, the key idea here is that we create objects and add as many properties as desired. Note that by writing the objects to the pipeline you separate your business logic from the presentation so you can do things like MyData | out-chart MyData | where {$_.Sales -gt 200} | out-chart You could also try the approach described by Marco Shaw on this post This is an approach we use in some internal scripts MyData.ps1 $oct = 134 $nov = 345 $dec = 239 $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "October" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $oct Write-output $obj $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "November" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $nov Write-output $obj $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Month -value "December" add-member -inputobject $obj -membertype NoteProperty -Name Sales -value $dec Write-output $obj In our scenarios, $oct = XXX is actually something like $oct = invoke-sql or more complex code, the key idea here is that we create objects and add as many properties as desired. Note that by writing the objects to the pipeline you separate your business logic from the presentation so you can do things like MyData | out-chart MyData | where {$_.Sales -gt 200} | out-chart You could also try the approach described by Marco Shaw on this post http://community.softwarefx.com/forums/t/9223.aspx Regards, JuanC
  15. Have you tried with other Process properties (e.g. WorkingSet, HandleCount). CPU is kind of special, if you do ps | get-member you will notice that most properties's MemberType are "Property" but CPU, Company and others are "ScriptProperty". Script properties are injected by PowerShell and we have had issues before with those properties. I would also recommend installing our most recent build.
  16. The PG profile just adds the powergadgets snapin so it is identical to running the default one and then doing add-pssnapin. JuanC
  17. Thank you for reporting this bug. It has been fixed in our current build for all possible ways of changing the palette (Menu, Wizard, PropertyGrid). This should be included in our next public build. JuanC
  18. Currently I am afraid this is not possible. Implementing -createlabellink would not be that hard as we could actually return the string so that you would do $a = out-map -createlabellinkstring Supporting -labellinkstring is a bit tricky though, as the map component we use internally expects a file. Our only workaround would be to create a temporary file but this is the same thing you can do today in the script with no additional benefits. We will consider this for future versions but I don't think we will be able to support this in V1 JuanC
  19. Refreshing is a very interesting feature in PowerGadgets. Hopefully we will make some time to blog about this in the not so distant future. The problem is that in order to support refresh we have to obviously reexecute the command that generated the data, the first tricky scenario is variables. We do support the following (if you are running a very old build it may not work) $a = "W*"ps $a | out-chart -refresh 0:0:5 Now run wordpad and check that the chart is refreshed with wordpad's process info. There are some subtleties on what type of variables we support but in the simple case it will just work. In your case - using functions - we are not able to push that function definition across so your gauge will not be refreshed. The only easy solution at this point is to move the body of the rr function to a PS1 file (e.g MyRandom.ps1) and then execute .\MyRandom.ps1 | out-gauge. In this case when we reexecute we ask powershell to reexecute MyRandom.ps1 and it should work as expected. Hope this helps JuanC
  20. PowerShell RC2 and 1.0 RTW contains the assembly System.Management.Automation with version 1.0.0.0 PowerShell RC1 contains the assembly System.Management.Automation with version 1.0.9567.1 According to the error you are getting you may have installed PowerGadgets for RC1 on a machine using PowerShell 1.0 RTW. Please redownload our installer for RC2/RTW, uninstall the old one and then install the new one. Regards, JuanC
  21. We will be uploading a new build next week (hopefully Monday or Tuesday). We've wanted to upload a new build for some days but after adding a couple of nice features we had to stabilize the product. Some of the features we added are: Size support in desktop gadgets including Icon mode. Flyout support in Vista including details about data points. UI cleanup. Multiple bug fixes. Regards, JuanC
  22. Although we support expressions in almost any parameters in out-gauge, we do not support them in out-chart yet. We will investigate if we can include this functionality for V1 but in the meantime you can use the following workaround. 1) import-csv employees.csv | select {[int]$_.Age*2},{"Mr or Mrs "+$_.Name} | out-chart We are using the select command to create 2 new calculated properties. In order to get a numerical value we had to cast $_.Age to an integer as import-csv returns all fields as strings. Also note that out-chart will not automatically pick up the labels (something we expect to fix in future builds) and the title for the series will be the expression. 2) import-csv employees.csv | select @{Expression={[int]$_.Age*2};Name="CorrectedAge"},@{Expression={"Mr or Mrs "+$_.Name};Name="CorrectedName"} | out-chart -values CorrectedAge -label CorrectedName We are now using a powershell feature that allows us to attach a symbolic name to each calculated expression, note that there is a bug in out-chart (already fixed in our internal build) that will make it ignore the CorrectedName property. This will be fixed in our next public build. Regards, JuanC
×
×
  • Create New...