header image

Archive for February, 2010

PSCX: get-opticaldriveinfo

Posted by: | February 18, 2010 | No Comment |

This useful for showing the supported formats 001 002 003 004 005 006 $drives = Get-OpticalDriveInfo foreach ($drive in $drives) {     $drive | Format-List MountPoint, VendorId, ProductId, ProductRevision      "Supported Profiles"     $drive | select -ExpandProperty SupportedProfiles | foreach {" $_"} }   Technorati Tags: PowerShell,PSCX

under: PowerShellV2

SQL Server backup

Posted by: | February 17, 2010 | No Comment |

An article I wrote for Windows Administration in Realtime has been posted on the Realtime Publishers tech tips site  http://nexus.realtimepublishers.com/tips.php then look for Solidifying Your Backup and Recovery Srategy for SQl Server It shows an example of using PowerShell to backup databases Technorati Tags: PowerShell,SQL Server

under: PowerShell and SQL Server

PSCX functions

Posted by: | February 16, 2010 | No Comment |

As well as a set of cmdlets – version 2 of PSCX delivers an interesting set of functions PS> Get-Command -Module pscx -CommandType function | format-wide -Column 3 Add-DirectoryLength                     Add-ShortPath                           cd- cd..                                    cd…                                   cd…. cd…..                                 cd\                                     cd~ cd+                                     Dismount-VHD                            Edit-File Edit-HostProfile                        Edit-Profile                            Enable-OpenPowerShellHere Get-ChildItem                           Get-Help                                Get-PropertyValue Get-PscxAlias                           Get-PscxCmdlet                          Get-PscxDrive Get-PscxFunction                        Get-PscxProvider                        Get-ScreenCss Get-ScreenHtml                          Get-ViewDefinition                      Invoke-BatchFile […]

under: PowerShellV2

  After creating a stored procedure we need to be able to run it 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 function Invoke-AccessStoredProcedure { # .ExternalHelp Maml-AccessFunctions.XML [CmdletBinding()] param (     [System.Data.OleDb.OleDbConnection]$connection,     [string]$name,     [switch]$grid )     $sql = "EXECUTE $name "     $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection)     $reader = $cmd.ExecuteReader()         […]

under: PowerShellV2

Hyper-V PowerShell library

Posted by: | February 15, 2010 | No Comment |

James has announced an update to his PowerShell Hyper-V library.  http://blogs.technet.com/jamesone/archive/2010/02/15/powershell-and-hyperv.aspx   download it from http://pshyperv.codeplex.com/releases/view/38769   Technorati Tags: PowerShell v2,Hyper-V

under: Hyper-V, PowerShellV2

PowerShell in Practice deal

Posted by: | February 13, 2010 | No Comment |

Manning are running a Deal of the Day Sunday 14 February for PowerShell in Practice   The deal is $15 for the ebook version.  Follow the link from http://www.manning.com/ and use discount code dotd0214   Please fell free to communicate to anyone you think may be interested   Enjoy Technorati Tags: PowerShell,books

under: Books, PowerShellV2

Access: Stored Procedure

Posted by: | February 13, 2010 | No Comment |

Next stop on our trip around Access functionality is the stored procedure.  An SP is a piece of code that we have defined, and saved in the database. It may take parameters or may just be a straight select statement. As with any Access object we have to start with creation 001 002 003 004 […]

under: Office 2010, PowerShellV2

UG Meeting 2 March 2010

Posted by: | February 13, 2010 | No Comment |

When: Tuesday, Mar 2, 2010 7:30 PM (GMT) Where: Virtual *~*~*~*~*~*~*~*~*~* Session will cover PowerShell v2 on Windows 7 and the default functionality. We will also look at the PowerShell functionality delivered in the Windows 7 Resource Kit. Notes Richard Siddaway has invited you to attend an online meeting using Live Meeting.Join the meeting.Audio InformationComputer […]

under: PowerShell User Group

Execution Policies

Posted by: | February 12, 2010 | No Comment |

By default PowerShell can’t run scripts when first installed because the execution policy is set to Restricted.  Lee Holmes has put a good explanation of some of the thinking around execution policies and what should be done about them – http://blogs.msdn.com/powershell/archive/2010/02/12/building-on-powershell-execution-policies.aspx   For more information see page 551 of Ed Wilson’s new book – Windows […]

under: PowerShellV2

PSCX: Set-VolumeLabel

Posted by: | February 11, 2010 | No Comment |

Need to change a volume label.  It couldn’t be easier. Set-VolumeLabel -Path g:\ -Label "Heroes" Will change the label of the g: drive. PSCX doesn’t supply a cmdlet to read volume labels.  But we can get round that with a bit of WMI 001 002 003 004 005 006 007 008 009 010 011 012 […]

under: PowerShell and WMI

« Newer Posts - Older Posts »