SAPIENScripter Posted March 20, 2007 Report Share Posted March 20, 2007 I'm trying to get the refresh option to work but not having any luck. Here's a short example of what I have and what I'm trying to do. In my profile script I have this function defined: Function Get-LogStamp {(get-date).toString('yyyMMddhhmmss')} In Powershell it works fine. I see it listed in Function: and generally it appears to be available. But when I do something like this: get-logstamp | out-gauge -type digital -refresh 0:0:10 When the refresh period comes around I get an error: The term 'get-logstamp' is not recognized as a cmdlet, function, operable program or script file. Verify the term and try again. I know it's a valid function name. Why the error? Jeffery HicksSAPIEN Technologies - Scripting, Simplified. www.SAPIEN.comVBScript & Windows PowerShell Training - www.ScriptingTraining.com/classes.aspWindows PowerShell? - www.SAPIENPress.com/powershell.aspblog: http://blog.SAPIEN.comblog: http://jdhitsolutions.blogspot.com EFF-Perception_Chart.zip Quote Link to comment Share on other sites More sharing options...
JuanC Posted March 20, 2007 Report Share Posted March 20, 2007 In order to refresh independently from the PowerShell session that created the gadget (so that you can close it and keep the gadget alive) we are hosting powershell and it seems we are not loading the functions in your profile. We will check if we can fix this bug in our next service pack. In the meantime you will have to create a script that returns the required data, e.g. Contents of logstamp.ps1 (get-date).toString('yyyMMddhhmmss') To make this workaround independent of your folder location you may also have to save this ps1 in a directory in your path. We apologize for the inconvenience. JuanC Quote Link to comment Share on other sites More sharing options...
SAPIENScripter Posted March 21, 2007 Author Report Share Posted March 21, 2007 I should have realized that. Using a script works just fine. Loading the profile would be helpful, or at least have the option. With PowerShell Community Extensions and other snapins becoming more popular, it makes sense that people will want to leverage those with PowerGadgets. Jeffery HicksSAPIEN Technologies - Scripting, Simplified. www.SAPIEN.comVBScript & Windows PowerShell Training - www.ScriptingTraining.com/classes.aspWindows PowerShell? - www.SAPIENPress.com/powershell.aspblog: http://blog.SAPIEN.comblog: http://jdhitsolutions.blogspot.com Quote Link to comment Share on other sites More sharing options...
SAPIENScripter Posted March 22, 2007 Author Report Share Posted March 22, 2007 Thought you might like to know what I was working on: http://blog.sapien.com/current/2007/3/21/powershell-temperature.html Jeffery HicksSAPIEN Technologies - Scripting, Simplified. www.SAPIEN.comVBScript & Windows PowerShell Training - www.ScriptingTraining.com/classes.aspWindows PowerShell? - www.SAPIENPress.com/powershell.aspblog: http://blog.SAPIEN.comblog: http://jdhitsolutions.blogspot.com Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.