That is exactly what I needed, thanks! -steve -----Original Message----- From: ADSM: Dist Stor Manager [mailto:[email protected]] On Behalf Of Del Hoobler Sent: Thursday, March 14, 2013 10:54 AM To: [email protected] Subject: Re: [ADSM-L] Need help getting TSM Selective to work in a Powershell script
Hi Steve, I did not realize you had the quotes in the variable. The following works successfully for me: [PS] D:\Program Files\Tivoli\tsm\baclient>$myBackupDir = "E:\folder with spaces" [PS] D:\Program Files\Tivoli\tsm\baclient>&.\DSMC SELECTIVE $myBackupDir\* -SUBDIR=Y Are you launching it differently? Note: In order to capture all files, include the \* at the end. Thanks, Del ---------------------------------------------------- "ADSM: Dist Stor Manager" <[email protected]> wrote on 03/14/2013 10:24:11 AM: > From: "Schaub, Steve" <[email protected]> > To: [email protected], > Date: 03/14/2013 10:25 AM > Subject: Re: Need help getting TSM Selective to work in a Powershell script > Sent by: "ADSM: Dist Stor Manager" <[email protected]> > > Del, > Still getting an error: > PS C:\Program Files\tivoli\tsm\baclient> $myBackupDir = "F:\folder > with spaces" > PS C:\Program Files\tivoli\tsm\baclient> &.\DSMC SELECTIVE > \"$myBackupDir\" -SUBDIR=Y ANS1107E Invalid option/value: '-SUBDIR=Y"' > PS C:\Program Files\tivoli\tsm\baclient> Thanks, -steve > > -----Original Message----- > From: ADSM: Dist Stor Manager [mailto:[email protected]] On Behalf > Of Del Hoobler > Sent: Thursday, March 14, 2013 10:16 AM > To: [email protected] > Subject: Re: [ADSM-L] Need help getting TSM Selective to work in a > Powershell script > > Hi Steve, > > Try placing a \ before each double-quote. For example: > > DSMC SELECTIVE \"C:\DIR WITH SPACE\" -SUBDIR=Y > > In your example: > > &.\DSMC SELECTIVE \"$myBackupDir\" -SUBDIR=Y > > > Thanks, > > Del > > ---------------------------------------------------- > > > "ADSM: Dist Stor Manager" <[email protected]> wrote on 03/14/2013 > 09:51:49 AM: > > > From: "Schaub, Steve" <[email protected]> > > To: [email protected], > > Date: 03/14/2013 09:54 AM > > Subject: Need help getting TSM Selective to work in a Powershell > > script Sent by: "ADSM: Dist Stor Manager" <[email protected]> > > > > I am building a script which will perform selective backups on a > > list of directories. > > This command works: > > &.\DSMC SELECTIVE $myBackupDir -SUBDIR=Y As long as the directory > > doesn't have any spaces in the name. > > I have been pulling my hair out trying to figure out how to get > > Powershell to pass the required double quotes to the TSM command so > > it > > will work. > > Anyone have a working example? > > TIA, > > > > Steve Schaub > > Systems Engineer II, Windows Backup/Recovery BlueCross BlueShield of > > Tennessee > > > > ----------------------------------------------------- > > Please see the following link for the BlueCross BlueShield of > > Tennessee E-mail disclaimer: > > http://www.bcbst.com/email_disclaimer.shtm > > > ----------------------------------------------------- > Please see the following link for the BlueCross BlueShield of > Tennessee E-mail disclaimer: > http://www.bcbst.com/email_disclaimer.shtm > ----------------------------------------------------- Please see the following link for the BlueCross BlueShield of Tennessee E-mail disclaimer: http://www.bcbst.com/email_disclaimer.shtm
