The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Archive for the ‘PowerShell’ Category

Powershell links (via: Scott Hanselmans 2011 Ultimate Developer and Power Users Tool List for Windows)

Posted by jpluimers on 2012/04/06

If you like .NET and scripting, then PowerShell and the PowerShell Community Extensions is what you should try:

PowerShell – The full power of .NET, WMI and COM all from a command line. PowerShell has a steep learning curve, much like the tango, but oh, my, when you really start dancing…woof. I also use PowerShell Prompt Here. Its built into Windows 7, by the way.

  • I also recommend after installing PowerShell that you immediately go get PowerTab to enable amazing “ANSI-art” style command-line tab completion.
  • Next, go get the PowerShell Community Extensions to add dozens of useful commands to PowerShell.
  • Want a more advanced GUI for PowerShell? Get the free PowerGUI.

Thanks Scott for summarizing :)

–jeroen

via: Scott Hanselmans 2011 Ultimate Developer and Power Users Tool List for Windows – Scott Hanselman.

Posted in .NET, Development, Power User, PowerShell, Scripting, Software Development | 1 Comment »

Some PowerShell SCCM links

Posted by jpluimers on 2012/03/22

http://www.powershell.nu/2010/10/07/powershell-sccm-client/

http://www.powershell.nu/tag/sccm-2007/

 

http://devinfra-us.blogspot.com/2008/04/sccm-and-powershell-part-1.html

http://devinfra-us.blogspot.com/2008/04/sccm-and-powershell-part-2.html

 

http://thepowershellguy.com/blogs/posh/archive/2008/05/16/sccm-and-powershell-series-using-my-powershell-wmi-explorer.aspx

http://thepowershellguy.com/blogs/posh/archive/tags/WMI+Explorer/default.aspx

http://thepowershellguy.com/blogs/posh/archive/2007/03/22/powershell-wmi-explorer-part-1.aspx

 

http://tfl09.blogspot.com/2010/03/sccm-powershell-module.html

 

http://www.snowland.se/2010/03/10/sccm-module-for-powershell/

http://www.snowland.se/sccm-posh/

 

Posted in .NET, PowerShell, Scripting, Software Development | Leave a Comment »

Enabling powershell to run unsigned scripts for the current user only (via: Absoblogginlutely!)

Posted by jpluimers on 2012/03/21

More than a year ago, I wrote about enabling PowerShell to run unsigned scripts, and a way to circumvent the “cannot be loaded because the execution of scripts is disabled on this system” error.

The solution  there uses the Set-ExecutionPolicy cmdlet, but only works for administrators. As of PowerShell 2.0, there is more fine grained control for the Set-ExecutionPolicy cmdlet, and an updated Set-ExecutionPolicy cmdlet topic which I overlooked.

The solution below shows what happens when the current user is not an administrator, and works around it by applying it only for the current user.

error message:

Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.

Sure enough I don’t have permission to this registry key.

I checked with our admin to ensure this wasn’t set in group policy before I started fiddling around. Found out that there is another setting that is user specific that can be set with

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

This will allow the current user to run unsigned scripts he wrote himself, but still require remote (for instance downloaded) scripts to be signed.

Note it is easy to strip the “remote” flag of a downloaded script: NTFS keeps this flag in the Zone:Identifier NTFS alternate data stream.
Only do that for scripts you trust.

–jeroen

via: Absoblogginlutely! » Enabling powershell to run scripts with registry permissions..

Posted in .NET, Development, PowerShell, Scripting, Software Development | 4 Comments »