Jump to content
Software FX Community

IGSFX

Staff
  • Posts

    156
  • Joined

  • Last visited

Everything posted by IGSFX

  1. If you want to connect PowerGadgets to CSV data, the easiest way to do so is using the import-csv cmdlet included with PowerShell. For example, let's assume you have a Sales.csv file with Units and Amount sold per Month, with the following data: Sales.csv Month,Units,Amount January,1723,134561.35 February,2167,141289.90 March,2541,165182.18 April,2643,190781.36 May,2434,175111.85 June,2934,204518.71 July,2338,163779.05 August,1834,136528.49 September,2840,188787.35 October,2612,187614.22 November,2411,190993.00 December,3025,211743.80 The first try to plot such data is running the following PowerShell command: import-csv Sales.csv | out-chart However, this will show an empty chart: /TeamBlogImages/ConnectingtoCSVdatafromPowerGadgets_59F0/NoDataAvailable.jpg The reason for this is that import-csv returns every field as a string, so PowerGadgets cannot know automatically which fields contain plottable data. PowerGadgets has the capability to cast any field to a number, when you specify which fields to plot using the -values parameter. You can also specify which field should be used as the X axis label with the -label parameter. The second try gives you the chart you want: import-csv Sales.csv | out-chart -values Units,Amount -label Month /TeamBlogImages/ConnectingtoCSVdatafromPowerGadgets_59F0/CsvChart2.jpg Connecting to CSV data from the PowerGadgets Creator The PowerGadgets Creator UI doesn't support the casting from strings capability (this is something we might enhance in a future version). For such reason, a different approach must be taken. Through the use of PowerShell's scriptblock capabilities, you can return an object that can be understood by the Creator. The PowerShell command to invoke from the PowerGadgets Creator data section is the following: import-csv Sales.csv | select Month,{$_.Units},{$_.Amount} /TeamBlogImages/ConnectingtoCSVdatafromPowerGadgets_59F0/CsvChartFromScriptblock_thumb.jpg This is almost the chart you want to obtain, but it's not quite there yet. If you review carefully, the chart legend shows $_.Units and $_.Amount because it's using the string passed to the series. To overcome this issue, we resource to a capabilty in the scriptblocks which is honored in PowerGadgets. Your final command is the following: import-csv Sales.csv | select Month,@{Expression={$_.Units};Name="Units Sold"},@{Expression={$_.Amount};Name="Sales Amount"} /TeamBlogImages/ConnectingtoCSVdatafromPowerGadgets_59F0/CsvChartFromScriptblock2_thumb.jpg IvanG
  2. I'm not sure the send email function is fully enabled. I'll have to check that and get back to you on this.
  3. By default, Community Server filters posts newer than 2 months. You can change that behavior in the More Options button at the bottom of the page. I think these options can be changed permanently if you're logged in. I think this is what may be affecting you, as we don't remove or archive articles. IvanG
  4. In a previous post we exposed how the out-chart and out-map cmdlets support scriptblocks in parameters that specify fields, such as -values. We also showed how it is also supported in almost any out-gauge parameter. However, support for scriptblocks in other chart/map parameters was not available at the time the blog entry was written. We have recently added support for scriptblocks in almost any chart/map parameter, but some additional configuration is required to use it. Let me start explaining how PowerGadgets plots the data received from a PowerShell pipe. Unlike gauges, which normally display one value at the time, charts and maps are used to display a number of values. Based on that fact, PowerGadgets inspects the piped data and plots all numeric properties found, unless you select one or more fields (properties) through the -values and -label parameters. For example, if you want to create a chart of the CPU used by the running processes, you can execute the following command: get-process | out-chart -values CPU -label Name Resulting in the following chart: On the other hand, if you want to use another property of the piped data in a chart parameter, for example the chart title, you would need to pass one value instead of a collection of values, because otherwise the chart wouldn't know which of the members of the collection should be used. To illustrate this case, let's say for a moment that you want to create the same chart shown before but refreshed every five seconds. Also, the chart title will be used to show the last time the data was acquired. For such purpose, let's create the ProcessesWithTime.ps1 script as follows: $datetime = get-date $processes = get-process $obj = new-object System.object add-member -inputobject $obj -membertype NoteProperty -Name DateTime -value $datetime add-member -inputobject $obj -membertype NoteProperty -Name Processes -value $processes $obj Essentially this script creates a new object with a property containing the current date & time and another property with a collection of Process objects. If you pipe the script to an out-chart cmdlet you will get a "No data available" message, since PowerGadgets could not find any numeric property in the piped data. Therefore, you need to specify which of the object's properties contains the data to be plotted, through the -DataObject property. You can now invoke the following: ProcessesWithTime | out-chart -dataobject Processes -values CPU -label Name Now, let's add the current datetime to the chart's title and refresh it every 5 seconds: ProcessesWithTime | out-chart -dataobject Processes -values CPU -label Name -titles_0_text {$_.DateTime} -refresh 0:0:5 Now, every 5 seconds your chart will be refreshed with current running processes data and the time shown in the title as follows: There are many uses for scriptblocks in chart parameters such as the value of a CustomGridLine or setting colors based on conditions not related to the data being plotted (such as in the RandomData example of our previous scriptblock post), among others. Note: this feature was added in the PowerGadgets build 1.0.2595, which was not publicly available at the time of posting this blog entry. If you want to get an interim build containing this feature, please contact our tech support (see website for details). IvanG
  5. The Windows PowerShell RTW installers for Windows Vista RTM are already available for free download: Download Windows PowerShell 1.0 Installation for X86 Edition Download Windows PowerShell 1.0 Installation for X64 Edition Further details can be found in the PowerShell Team blog. We recommend installing Windows PowerShell prior to installing PowerGadgets in order to take advantage of some features that are only available through the use of the PowerGadgets cmdlets. However, the PowerGadgets Creator allows the creation of gadgets connecting to databases and web services without the need of Windows PowerShell. IvanG
  6. The latest licensed version available is also 1.0.2588. If you have an older version you may want to re-download the latest version from the URL indicated in the email you received with your purchase. Please make sure you uninstall your previous version before installing the latest build. IvanG
  7. What you are looking for is achieved using the ConditionalAttributes parameter. For example, the following line will color any point between 5 and 20 in Red: import-csv chart.tmp|out-chart -values value -label country -palette highcontrast -series_0_gallery lines -ConditionalAttributes_0_Color Red -ConditionalAttributes_0_Condition_From 5 -ConditionalAttributes_0_Condition_To 20 Your sample will reflect better the condition if you use a bar chart instead of lines. since gradual changes are not supported. It will also show fine if you add another entry to your csv file, like: Canada, 15. If you create several ConditionalAttributes it can become quite verbose. One option to overcome this is to use the Template Creator (using out-chart -config)
  8. Since our first PowerGadgets public build in November 2006 (1.0.2508), we have made a series of bug fixes and added a number of interesting new features, based on our research and customer feedback. The features we have added since the build 1.0.2508 are: Support for Drilldown: this is one of the features most often required by our customers. Now PowerGadgets supports drilldown through hierarchical data as well as drilldown to a separate script, allowing for very useful scenarios. Drilldown is available through any of the PowerGadgets display cmdlets. Creation of native Windows Vista Sidebar gadgets: now the PowerGadgets Creator allows packaging gadgets as native Sidebar gadget files (.gadget) allowing for an even easier deployment. Gadget files are highly customizable and can even be signed through a comprehensive wizard. This option is available through the Creator File menu. Password Encryption: in order to increase the security of our gadgets, we now support password encryption in the PowerGadgets files created with the PG Creator. Passwords can be stored using any of the following methods: Saved as Clear Text: passwords are not encrypted. Encrypted using information from the local computer and current user: passwords are encrypted using DPAPI, which is highly secure but can only be decrypted in the same machine/user in which it was encrypted. This is the default option, useful for personal use. Encrypted using a Digital Signature: passwords are encrypted using a certificate which must be deployed to any computer in which the gadget plans to run. Clipboard support: cut/copy/paste is now available in the PowerGadgets Creator and the Template Creator. This allows for an easy duplication of a gadget within a group. This also allows you to copy all the features from a template (created using the -config parameter) to a gadget file, and viceversa. Clipboard support is also available through any gadget created using one of the PowerGadgets cmdlets (out-chart, out-gauge and out-map). Pressing Ctrl-C on a running gadget will copy it to the clipboard, which can be then pasted into the PowerGadgets Creator and the Template Creator. The gadget is also copied as a bitmap, in case you want to paste it into another application, such as Word, Excel or any graphical tool. Enhancements in Gadget Sizing: besides the basic -size <width,height> option provided initially, we have added some preset sizing options (Larger, Large, Medium, Small, Smaller and Icon). Those options are available through the cmdlets -size parameter (even included in tab completion) as well as the Creator (Edit -> Desktop Settings -> Layout...) and more importantly, as an end-user tool (right-click -> Size). One interesting size option we added is Icon, which minimizes the desktop real estate occupied by the gadgets. In the case of charts and maps, each size option changes font sizes and hides/shows tools automatically in order to maximize data display. For example, the legend box's font size is reduced in the Small size and completely hidden in Smaller and Icon sizes. The Icon size option goes even beyond and applies a minimal-ink algorithm, which we also use in our Vista Sidebar gadgets. The following image shows a chart of the current processes (get-process) in three different sizes: Large, Smaller and Icon: Sidebar FlyOut support: Windows Sidebar offers an interesting feature called FlyOut, which is typically used to display further information about a gadget when you click on it. One example of the use of FlyOuts is the Feed Headlines gadget included with Vista, which is used to show the details of a news when you click on it. When you click on any gadget created with PowerGadgets, a details FlyOut appears with detailed information about the gadget. In the case of any of our gauges (vertical, linear or digital), the FlyOut shows the details of the different values shown in it, which are normally just a few. In the case of charts and maps, since the number of values shown may be larger than a gauge, the functionality is even more powerful. You can hover the mouse on any of the data points and the chart will highlight such point on the chart (by dimming the rest of the values) and will display the details on the FlyOut window, such as shown below: Resource Optimization when refreshing: this enhancement is not too visible but is very important to improve resource usage. Originally, we maintained an open connection to the data provider (database connection or PowerShell session) for self-refreshing gadgets while the gadget was running, regardless of the refresh timespan. This was useful for small refresh times because we didn't have to pay the price of creating a new connection with every refresh, but on the other hand, it maintained an open connection permanently, which was a waste of resources for larger refresh times. Now, we maintain the connection open only if the refresh time is one minute or less. This default behavior can be overridden in the PowerGadgets Creator (Data -> Keep Connection Open). Sidebar Visibility Support: now the Sidebar gadgets stop refreshing when they are not visible, thus saving resources. There are different scenarios in which the Sidebar gadgets are not visible, such as when you close the Sidebar. Some other scenarios are shown here: http://news.softpedia.com/news/Windows-Vista-Gadget-Visibility-34715.shtml Enhancements in Group Tabs: this new version supports closable tabs, as well as keyboard support for navigation (Ctrl-<index>, Ctrl-Home, Ctrl-End) and closing (Ctrl-W) ScriptBlocks support improvements: this version now supports specifying scriptblocks in the -values and -label parameters. For example, we now support this: ps | out-chart -values {$_.Handles + 10} -label {$_.Name + "-" + $_.Company} ScriptBlocks are also supported in a special XML file we provide for configuring defaults (DefaultViews.xml). We expect to elaborate on the ScriptBlock support capabilities in a different blog post. Snapins support in Creator: the PowerGadgets Creator now supports access to cmdlets from other registered snapins when using the PowerShell data option. ODBC support: now we support ODBC natively through the PowerGadgets Creator. It is also supported via the invoke-sql cmdlet; when the connection string starts with ODBC it will use ODBC for connection. Error Handling in Desktop gadgets: when there is an error trying to refresh the data for a gadget, an error icon will appear in one of the gadget's corners. Clicking on the icon will show a dialog with error details. This feature was previously supported on Sidebar gadgets only. Credential support: PowerShell credential objects are now supported in the invoke-sql and send-mail cmdlets. DataSet support in Web Services: now you can use the invoke-webservice cmdlet returning a DataSet and the out-chart, out-gauge and out-map cmdlets will use it properly. HideFromAltTab support: showing multiple gadgets on your desktop is very useful since it becomes the desktop an ideal dashboard container. However, it may clutter the dialog when you press Alt-Tab to switch among running windows. To avoid this, you can use the -HideFromAltTab parameter with any of our display cmdlets. This option is also available through the PowerGadgets Creator (Edit -> Desktop Settings -> Hide from Alt-Tab). In future blogs, we plan to elaborate in some of the features exposed above. Feedback regarding new features is always welcome. IvanG
  9. A new build fixing this issue is publicly available now at www.powergadgets.com/trial. Make sure you remove your current version before installing the new build. We apologize for any inconvenience this may have caused you. IvanG
  10. We detected an issue which caused PowerShell to hang under certain circumstances. The issue has been fixed and a new public build is already available. Please download the latest version from www.powergadgets.com/trial. Make sure you uninstall your current version before installing the new build. We apologize for any inconvenience this may have caused you. IvanG
  11. - Create a script called ImportCsvWeb.ps1 with the following $url = $args[0] $tempFile = [system.IO.Path]::GetTempFileName() $webClient = new-object System.Net.WebClient $webClient.DownloadFile($url,$tempFile) $data = import-csv $tempFile [system.IO.File]::Delete($tempFile) $data - Invoke it in a powershell session (or script) as follows .\importcsvweb.ps1 "http://<your csv file URL>" | out-chart -values <ValueColumns> -label <LabelColumn> Note that in this case we let ImportCsvWeb to return the data without any "casting" to allow reuse of this script with multiple CSV files. You tell the out-chart cmdlet which fields should be plotted through the -values parameter (which must contain only numbers)
  12. There is a missing close quote in your pipe (after Microsoft*). First, I tried your line and got a >> symbol from PowerShell, which indicated that the line was not complete for execution. Then I realized about the missing quote and tried the following, which works fine for me: PS | where {$_.Company -like "*Microsoft*"} | out-chart I also tried your line without piping to out-chart, with the same results (>>): PS | where {$_.Company -like "*Microsoft*} IvanG
  13. We have enabled this option. Thank you for pointing this out. IvanG ChartFX_Zoom_Exception.zip
  14. The PowerGadgets architecture is much more complex than that. We have a large number of executables and processes interacting with each other and with the system resources. Explaining those interactions in a few lines would be almost impossible and would also reveal parts of our technology which we are not allowed to. I am sorry we can't be any more specific on this issue. On the other hand, if you elaborate on the type of widgets/gadgets you are creating, perhaps we can help you achieve them through the use of any of our PowerGadgets cmdlets. That would give you the advantage of using all the features we have implemented in PowerGadgets through thousands and thousands of man-hour in research and development. Regards Ivan GiugniProduct ManagerPowerGadgets
  15. Executing any of our cmdlets does not block PowerShell by default. There is one option in which PowerShell is blocked until you close the gadget, which is when you execute the cmdlet with the -modal option. In that case, the chart/gauge/map is shown in a modal window, which blocks PSH until you close it; there are a few circumstances in which you may want to show the gadget in modal way, but it is not the default behavior. Can you please elaborate on how you are running your cmdlets? IvanG
  16. In our initial usability tests, it seemed that having shortcuts to the samples in the Start menu could be somehow misleading because they didn't execute upon clicking on the sample, but rather the ps1 was open. For such reason, we decided to leave the samples folder but removing the links. We are still debating whether exposing the samples through the Start menu is a good practice or not. What is your opinion on that?
  17. We should upload a new installer later this week fixing this issue. In the meantime, you can use the file attached to this post. TestApplication.zip
  18. You probably have an older installer with instructions for PowerShell RC1. In the RTW version of PowerShell, the name and location changed to the following: Folder name: WindowsPowerShell (containing the profile.ps1)Must be copied to your \My Documents folder. The instructions you mention in your post apply to the RC1 version of PowerShell. IvanG
  19. Thank you very much for your suggestion. Even though we currently don't support specifically an out-workflow cmdlet, we do support an out-map cmdlet which can be configured to work as a State Machine Work Flow. The out-map cmdlet allows you to draw the different objects of a given shape (for example a map) in different colors based on the underlying data and a set of rules. This cmdlet can be customized to draw any given shape, in addition to the hundreds of maps included with the product. We include one example called ServerMap.ps1 under the Maps subfolder, which changes the state of a server from online (green) to offline (red). For details about how to create your own map, please contact support at powergadgets dot com. IvanGPowerGadgets
  20. In order to run a pgf file you need PowerGadgets installed on the client computer. For evaluation purposes, all you need to do is installing the trial version. Once you are ready to deploy, we offer Client licenses which include the functionality required to run pgf files as well as any of our PowerShell cmdlets. You will need a Creator license to create pgf files or to run the template creator through the -config parameter. We don't foresee providing a trial version with the client functionality only. BTW, the product was formally released on November 14th, so it is NOT BETA any longer. We still have some online resources which the beta testers accessed during the beta phase, but those resources will be taken offline very soon.
  21. We removed th "Who is online" earlier today. I'm not sure about the Home link, though.
  22. If you are creating a full Windows Forms application then you should use Chart FX for Visual Studio 2005 and Chart FX Extension Pack (maps), since those are the base components used by PowerGadgets. You will have all of functionality currently provided by out-chart/out-map, with the advantage of using a native WinForms component. A webforms component is also available, as well as gauges (Chart FX Gauges). Chart FX information is found at www.softwarefx.com.
  23. The latest installer uses the same settings as the PowerShell command window. I'm not sure if the public trial already has those settings, but in any event, the next public build will have it.
  24. Upon further review, we detected that the line was not intentionally draw in the map, but it was kind of a bug in the SVG. The updated SVG will be included in the next public build, but if you need it right away, please contact us at support@softwarefx.com.
×
×
  • Create New...