![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | -container in Copy-Item Hi all I am trying to find out what are the possible values for -container like in Copy-Item .... -container WHAT? What are the possible values for what comes after -container? Help says its a "switch" .... and that means that the possible values are? perhaps -container ON or container OFF ? or -container Y or N ? 1 or 0 ? T or F ? Technet does not anything more than help on this -container Thanks for your help |
My System Specs![]() |
| | #2 (permalink) |
| | Re: -container in Copy-Item It's a SwitchParameter. A SwitchParameter takes boolean values. Generally, when you specify a SwitchParameter it's equal to $true otherwise it's $false. As you can see below, $true is the default. PS > help Copy-Item -full (...) -container <SwitchParameter> Preserves container objects during the copy operation. Required? false Position? named Default value True Accept pipeline input? false Accept wildcard characters? false You can also specify it like so (disable): Copy-Item -container:$false ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > Hi all > > I am trying to find out what are the possible values for -container > > like in Copy-Item .... -container WHAT? > > What are the possible values for what comes after -container? Help > says its a "switch" .... and that means that the possible values are? > > perhaps -container ON or container OFF ? > > or -container Y or N ? > > 1 or 0 ? > > T or F ? > > Technet does not anything more than help on this -container > > Thanks for your help > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: -container in Copy-Item You usually use switches with nothing after them, as this short function illustrates .... function switchtest { param([switch]$MySwitch) Write-Host $MySwitch } #Output...... PS (2) > switchtest False PS (3) > switchtest -myswitch True PS (4) > -- Jon "hugh" <hugh@xxxxxx> wrote in message news:fp6uh5$9aj$1@xxxxxx Quote: > Hi all > > I am trying to find out what are the possible values for -container > > > like in Copy-Item .... -container WHAT? > > What are the possible values for what comes after -container? Help says > its a "switch" .... and that means that the possible values are? > > perhaps -container ON or container OFF ? > > or -container Y or N ? > > 1 or 0 ? > > T or F ? > > Technet does not anything more than help on this -container > > Thanks for your help |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Copy-Item : Container cannot be copied onto existing leaf item. | PowerShell | |||
| Can the copy-item cmdlet be used to copy public folders to C: ? | PowerShell | |||
| copy-item changing files attributes on network copy failures | PowerShell | |||
| Copy-Item not honoring -container | PowerShell | |||
| Copy-Item not honoring -container | PowerShell | |||