Filter Objects returned by Get-ChildItem

Hello there,
I had a look at the properties available for objects returned by Get-ChildItem command using:
PS C:\> Get-ChildItem | Get-Member
This command shows that objects returned by Get-ChildItem command possess properties
'Name, FullName, LastAccessTime etc...'
If I declare a variable to retrieve objects starting with 'Program':
PS C:\> $ChildItems_Program = Get-ChildItem -name 'Program*'
and check what is stored in $ChildItems_Program, it shows me two objects/items as shown below:
PS C:\> $ChildItems_Program
Program Files
Program Files (x86)
However if I try to access properties 'Name, FullName, LastAccessTime' from the first object saved in $ChildItems_Program
PS C:\> $ChildItems_Program[0] | Select -Property Name, FullName, LastAccessTime
Name FullName LastAccessTime
I can't see any results for above command- Shouldn't it return the properties of first object saved in $ChildItems_Program?
Can anyone please guide.
Thank you!
    

Hi,
Tommy is right, using -Name doesn't actually return the full object. When you use that parameter, you're getting back an array of names only. Here's how you can tell:
PS C:\> $ci_program = Get-ChildItem -Name 'Program*'
PS C:\> $ci_program.GetType()
IsPublic IsSerial Name BaseType
True True Object[] System.Array
PS C:\> $ci_program[0].GetType()
IsPublic IsSerial Name BaseType
True True String System.Object
PS C:\> $ci_program[0] | Get-Member -MemberType Property
TypeName: System.String
Name MemberType Definition
Length Property int Length {get;}
PS C:\> $ci_program
Program Files
Program Files (x86)
Here's what you should see if you get objects back from gci, using -Filter (I use -Path here):
PS C:\> $ci_program_object = Get-ChildItem -Path 'Program*'
PS C:\> $ci_program_object.GetType()
IsPublic IsSerial Name BaseType
True True Object[] System.Array
PS C:\> $ci_program_object[0].GetType()
IsPublic IsSerial Name BaseType
True True DirectoryInfo System.IO.FileSystemInfo
PS C:\> $ci_program_object[0] | Get-Member -MemberType Property
TypeName: System.IO.DirectoryInfo
Name MemberType Definition
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property datetime CreationTime {get;set;}
CreationTimeUtc Property datetime CreationTimeUtc {get;set;}
Exists Property bool Exists {get;}
Extension Property string Extension {get;}
FullName Property string FullName {get;}
LastAccessTime Property datetime LastAccessTime {get;set;}
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
Name Property string Name {get;}
Parent Property System.IO.DirectoryInfo Parent {get;}
Root Property System.IO.DirectoryInfo Root {get;}
PS C:\> $ci_program_object
Directory: C:\
Mode LastWriteTime Length Name
d-r-- 1/26/2014 12:40 AM Program Files
d-r-- 3/28/2014 12:07 PM Program Files (x86)
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)

Similar Messages

  • Inconsistency between get-childitem -include and -exclude parameters

    Hi,
    Powershell 2.0
    Does anyone else consider this a minor design bug in the Get-ChildItem command?  
    # create dummy files
    "a","b","c" | % {$null | out-file "c:\temp\$_.txt"}
    # this "fails", returns nothing
    get-childitem c:\temp -include a*,b*
    # this "works", returns desired files
    get-childitem c:\temp\* -include a*,b*
    # this "works", excludes undesired files
    get-childitem c:\temp -exclude a*,b*
    # this "fails", excludes undesired files BUT RECURSES sub-directories
    get-childitem c:\temp\* -exclude a*,b*
    I'm writing a wrapper script around the GCI cmdlet, but the inconsistency between the two parameters is problematic.  My end user will surely just type a path for the path parameter, then wonder why -include returned nothing.  I can't unconditionally
    add an asterisk to the path parameter, since that messes up the exclude output.
    I'm just wondering why Microsoft didn't make the parameter interaction consistent???  
    # includes desired files in the specified path
    get-childitem -path c:\temp -include a*,b*
    # excludes undesired files in the specified path
    get-childitem -path c:\temp -exclude a*,b*
    # combine both options
    get-childitem -path c:\temp -include a*,b* -exclude *.log,*.tmp
    # same as above, the asterisk doesn't matter
    get-childitem -path c:\temp\* -include a*,b*
    get-childitem -path c:\temp\* -exclude a*,b*
    get-childitem -path c:\temp\* -include a*,b* -exclude *.log,*.tmp
    # same as above, but explicitly recurse if that's what you want
    get-childitem -path c:\temp\* -include a*,b* -recurse
    get-childitem -path c:\temp\* -exclude a*,b* -recurse
    get-childitem -path c:\temp\* -include a*,b* -exclude *.log,*tmp -recurse
    If I execute the "naked" get-childitem command, the asterisk doesn't matter...
    # same results
    get-childitem c:\temp
    get-chileitem c:\temp\*
    If this isn't considered a bug, can you explain why the inconsistency between the two parameters when combined with the -path parameter?
    Thanks,
    Scott

    The Get-ChildItem cmdlet syntax is horrific for advanced use. It's not a bug in the classic sense, so you shouldn't call it that. However, feel free to call it awful, ugly, disastrous, or any other deprecatory adjective you like - it really is
    nasty.
    Get-ChildItem's unusual behavior is rooted in one of the more 'intense' dialogues between developers and users in the beta period. Here's how I recall it working out; some details are a bit fuzzy for me at this point.
    Get-ChildItem's original design was as a tool for enumerating items in a namespace -
    similar to but not equivalent to dir and
    ls. The syntax and usage was going to conform to standard PowerShell (Monad at the time) guidelines.
    In a nutshell, what this means is that the Path parameter would have truly just meant Path - it would not have been usable as a combination path specification and result filter, which it is now. In other words
    (1) dir c:\temp
    means you wanted to return children of the container c:\temp
    (2) dir c:\temp\*
    means you wanted to return children of all containers inside
    c:\temp. With (2), you would never get c:\tmp\a.txt returned, since a.txt is not a container.
    There are reasons that this was a good idea. The parameter names and filtering behavior was consistent with the evolving PowerShell design standards, and best of all the tool would be straightforward to stub in for use by namespace
    providers consistently.
    However, this produced a lot of heated discussion. A rational, orthogonal tool would not allow the convenience we get with the dir command for doing things like this:
    (3) dir c:\tmp\a*.txt
    Possibly more important was the "crash" factor.  It's so instinctive for admins to do things like (3) that our fingers do the typing when we list directories, and the instant failure or worse, weird, dissonant output we would get with a more pure Path
    parameter is exactly like slamming into a brick wall.
    At this point, I get a little fuzzy about the details, but I believe the Get-ChildItem syntax was settled on as a compromise that wouldn't derail people expecting files when they do (3), but would still allow more complex use.  I think that this
    is done essentially by treating all files as though they are containers for themselves. This saves a lot of pain in basic use, but introduces other pain for advanced use.
    This may shed some light on why the tool is a bit twisted, but it doesn't do a lot to help with your particular wrapping problem. You'll almost certainly need to do some more complicated things in attempting to wrap up Get-ChildItem. Can you describe some
    details of what your intent is with the wrapper? What kind of searches by what kind of users, maybe? With those details, it's likely people can point out some specific approaches that can give more consistent results.

  • Filter Get-ChildItem on TargetPath?

    With Get-ChildItem is it possible to filter on a shortcut's TargetPath? I did a Get-Member on a shortcut and I don't see anything there that looks promising, so I am filtering to just get shortcuts, then looping and evaluating 
    if (($Shell.CreateShortcut($Shortcut.FullName)).TargetPath -eq $Document)
    where $Document is the TargetPath I am looking for. And it works. But I wonder if there is a pipeline way to do it, rather than the loop?

    Hi Gordon,
    I'm afraid not, because the "$Shell.CreateShortcut" doesn't accept array, and we also can't find the targetpath information with the cmdlet "Get-Childitem", so the foreach seems a good way:
    Get-ChildItem d:\*lnk -Recurse|Select-Object -ExpandProperty fullname|foreach{
    $Shortcut = New-Object -COM WScript.Shell
    $Shortcut.CreateShortcut($_).TargetPath}
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Powershell Get-childItem: The specified path, file name, or both are too long.

    Hey Scriping Guys!
    I've been using a PowerShell script for a couple of years now to generate a monthly report showing the size of user folders on a number of departmental file servers.  It's working just fine on all file servers except one where the users have gotten carried away with creating sub-folders and using realy long descriptive file names.  The problem piece of script is this:
    $colItems = (Get-ChildItem \\192.168.10.5\marketing -recurse | Measure-Object -property length -sum)
    "marketing-serv\marketing: "+"{0:N2}" -f ($colItems.sum / 1GB) + " GB"
    The reply I get is:
    Get-ChildItem : The specified path, file name, or both are too long. The fully
    qualified file name must be less than 260 characters, and the directory name mu
    st be less than 248 characters.
    At G:\data\Server_space_Report\serverspace2.ps1:37 char:27
    + $colItems = (Get-ChildItem  <<<< \\192.168.10.5\marketing -recurse | Measure-Obje
    ct -property length -sum)
    Yes, the message is correct, however, when I connect to the server, right click the folder and chose properties it returns a size of 128 GB.  My questions are
    1. Why does clicking on folder properties not produce an error (what is it doing differently from my script)?
    2. How can I fix my script?
    Thanks,

    I am trying to clear up the older open posts on this forum. If this is still an unresolved issue for you please let me know. If you do not post back within one week I will assume it is resolved and will close this thread.
    Thank you
    Ed Wilson
    Microsoft Scripting Guy

  • CM-ImportDriver and Get-ChildItem

    I am trying to use the CM-ImportDriver Cmdlet and running into a problem.  After I import the module, I change my site to ABC1:.  From there, I cannot use Get-ChildItem for a UNC path and the CM-ImportDriver throws an error saying it needs a valid
    driver to import.  That happens because it cannot access the UNC path from earlier.  If I change back to C:, then I can run Get-ChildItem with no problem.  What do I need to do in order to bridge the gap between using C: and ABC1:? 
    The CM-ImportDriver requires a UNC path to pull the stored drivers from, which is fine. However, I cannot get it to read the UNC paths provided.   Thanks in advance. 
    Best, Jacob I'm a PC.

    Hi,
    This is taken from here Get-ChildItem - In its basic form the Get-ChildItem cmdlet provides functionality similar to the dir command. For example, if you simply type Get-ChildItem
    at the Windows PowerShell prompt you’ll get back information about the objects in the current location.
    For example this lists HKLM registry child items
    Set-Location HKLM:
    Get-ChildItem
    For example this lists C:\ drive child items
    Set-Location C:\
    Get-ChildItem
    For example in CM 2012 R2 it lists all the admin console nodes
    Set-Location PS1:\
    Get-ChildItem
    You need to query the driver sources before you change the connection context to your site code. For example like this
    #Step 1
    Set-Location C:\
    $Drivers = Get-childitem -path "\\cm01\Sources\OSD\Drivers\Sources\Lenovo\W7x64\T500" -Recurse -Filter "*.inf"
    #Step 2
    Set-Location PS1:\
    foreach($item in $Drivers)
    Import-CMDriver -UncFileLocation $item.FullName
    Best,
    Kaido

  • Get-ChildItem on version 2.0 vs 3.0

    Not sure if this has been discussed or is known, but I found an interesting issue when running Get-ChildItem on version 2.0 vs 3.0
    So I have the simple command of
    $files = Get-ChildItem -Path $Source -Recurse -ErrorAction SilentlyContinue -ErrorVariable myError
    If $Source only contains 1 file, then $files is of type System.IO.FileInfo, whereas, if there are more than one, it would be of type Syste.Array. I actually thought $files would always be a collection, no mater if there was one or multiple files, but obviously
    I was wrong.
    So with thinking it will always be a collection, I used $files.Count for my Write-Progress
    Write-Progress -Activity "Backing up Files" -Status "File: $src-->$dest" -PercentComplete ($counter / $files.Count*100)
    Everything on my machine worked and I am running version 3.0, so I put the script on a machine that was running 2.0 and the Write-Progress failed with cannot divide by zero..hmmmmm
    So doing a little testing, I ran the Get-ChildItem command on version 2.0 and then did $files.Count which returned nothing due to $files being System.IO.FileInfo, and it doesn't have a property of Count, but if you run it on version 3.0 and then do $files.Count,
    even though $files doesn't have a Count property when it is of type Syste.IO.FileInfo or System.IO.DirectoryInfo, it will return 1
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

    In PowerShell 3.0 or later, you can check a .Count property on any value (even $null.Count); it was added along with the Member Enumeration feature.  This works for .Length as well.  If no property / field named Count or Length exists on the object,
    PowerShell will enumerate it for you and return the number of objects
    When you're needing to support PowerShell 2.0, you need to be more careful.
    On a side note, use the syntax in Boe's last post, with the @() operator around the command that you ran.  There's a subtle difference between these two:
    $files = @(dir DoesNotExist.txt -ErrorAction SilentlyContinue)
    $temp = dir DoesNotExist.txt -ErrorAction SilentlyContinue
    $files2 = @($temp)
    $files.Count # 0
    $files2.Count # In PowerShell 2.0, this will be 1. In 3.0 or later, it's 0.
    This is because there are technically two different kinds of Null values that the PowerShell engine recognizes:  actual null references, and a value called AutomationNull, which is used to represent a command which didn't output anything.  In PowerShell
    2.0, when you assign the result of a command to a variable, it didn't keep track of whether the result was AutomationNull or not, resulting in this weird behavior.  3.0 and later correct this.
    Here are a couple of other demonstrations of this in action:
    $array1 = @($null)
    $array2 = @([System.Management.Automation.Internal.AutomationNull]::Value)
    $array1.Count # 1
    $array2.Count # 0
    function ReturnsNull { return $null }
    function ReturnsNothing { }
    $array1 = @(ReturnsNull)
    $array2 = @(ReturnsNothing)
    $array1.Count # 1
    $array2.Count # 0

  • Assigning Filter Object Type for Internal Order

    Hi All,
    I have a requirement to send a INTERNAL_ORDER IDOC to another system on creation or on change of an order. I have created the model view and added the BAPI InternalOrder.SaveReplica in the distribution model (BD64) and the next step was for me to add a filter. I tried creating a filter group but then I get the message "Select node:Content-dependent parameter filtering". I have done a similar configuration for PROJECT idoc before and I was able to solve this by configuring in BD95 - Defining the filter object type and then BD81 - Assigning the filter object type to the parameter. However now when I try and implement the same steps for the Internal Order IDOC, I am having trouble assigning a filter object type to a parameter. I want to filter by company code and so far I was able to define the filter object type (BUKRS) in BD95 and then when I go on to try and assign this to the BAPI Parameter in BD81 , only 1 parameter appears (objectstatus) when I drop down for the parameter options.
    The row entry that I am trying to add is:
    Obj. Type
    Method
    Filter object type
    Parameter
    Field Name
    BUS2075
    SAVEREPLICA
    BUKRS
    MASTERDATA
    COMP_CODE
    But only OBJECTSTATUS appears in the Parameter block as an option when I press F4.
    Further more when I try save the entry as above, I get an error. Error Message: "Entry MASTERDATA does not exist in (check entry)"
    Can I please get some guidance on how to filter the internal order by company code or more importantly advise on which step I may have skipped in order have “MASTERDATA” appear as an option for Parameter field in BD81.
    Thank you.

    Hi,
    I need to pass object key or object type to a function module 'SAP_WAPI_WORKITEMS_TO_OBJECT'. This function module returns the worklist details(workflow inbox). In worklist details i need to use the field for workitem id.
    Regards,
    Gautham

  • Filter Object with Filter Expression error.

    Hello everyone!
    I'm trying to put together the following expression for a filter to be used in a report:
    Order Date -> object name = M1 - (number, measure)
    Current Date -> object name = M2 - (number, measure)
    Comparison between the two:
    <EXPRESSION> IIF (@ Select (M1) = @ Select (M2), 1.0) </EXPRESSION>
    object name 3
    So far everything works fine.
    When I create a report in Web and I put the filter M3 = 1, it filters properly.
    I thought of putting the filter in a filter object in the universe, like this:
    <FILTER EXPRESSION = "Select @ (M3)"> <CONDITION
    OPERATORCONDITION = "Equal"> <CONSTANT CAPTION="1"/></CONDITION></FILTER>
    Just as it is in Olap universes best practices written by Didier. (Page 12), as following example:
    Filter with a calculated member referenced in the filter expression:
    <FILTER EXPRESSION="@Select(Calendar Year\My Calculated Member)"><CONDITION
    OPERATORCONDITION="Equal"><CONSTANT CAPTION="1"/></CONDITION></FILTER
    But does not work when I put the query, the error is dpscommand. And I have no idea where the error is.
    The strange thing is it works, if I filter the query directly. ( Query filter: M3 equal 1).
    Do you have any tips? or something I could try that I have the M3 as a filter object?
    Tks a lot!
    Livia
    I am working on BO XI R3 - SP2 and the basead query is on SAP BW 7.0.

    macearl wrote:
    SQL View does not display unless data is returned by the query. Is that normal?
    Also, none of these options shows the literal result of the expression we built, i.e.:
    expression: CAST(YEAR(TIMESTAMPADD(SQL_TSI_MONTH, -24, CURRENT_DATE)) as CHAR)
    result: *2008*
    Having the ability to test expressions and see their results would be very helpful in debugging. If anyone knows how to do that please share!
    Thanks!
    MacOk, Probably shoud have figured this out before, but in response to my own question, the way to view the result of an expression is to add the expression as a column and include it in the Table Presentation.
    - Mac (he can be taught)

  • Get-ChildItem Issue With Variable

    I hope some very clever person out there can resolve this without even thinking, however my brain seems to be blocked.
    $FileVersion
    = (Get-ChildItem
    C:\Windows\System32\drivers\somedriver.SYS).VersionInfo
    |
    Select-Object
    FileVersion
    If ($FileVersion
    -eq
    "2, 0, 0, 1") {Copy-Item
    -Force
    "C:\local\somedriver.SYS","C:\Windows\System32\drivers\somedriver.SYS"} 
    I have verified this and $FileVersion does in fact equal 2, 0, 0, 1 however starts as a formatted table.
    FileVersion
    2, 0, 0, 1
    I think it must be passing the variable as the whole table, I also tried adding in my if statement the value @{FileVersion=2, 0, 0, 1 however that also failed.
    Any ideas what I'm missing here?
    Many Thanks

    If the strings are not in the same format then the files are not the same.  Simple logic.  IF they are in the same format and compare exactly then the strings are identical.  Who cares what is in them?
    Comparing to equal will always work.  If they do not compare as equal you know the files are different.
    That is all. That is all I said.  No need to make more of it.
    ¯\_(ツ)_/¯
    You never answered how you're getting this string. Again, as I've said in more than one post now, if you're using .VersionInfo.FileVersion, that string is not accurate for a significant number of files (especially Microsoft files).
    You are correct when you say that if the strings don't match they're not the same. But you're forgetting that the strings may be the same and yet the file isn't the same. To me, that's a big deal. If you're cataloging file versions, your information could
    be incorrect.
    Here's a scenario:
    1. I check the 'mshtml.dll' VersionInfo.FileVersion today. It reports back that it is '11.00.9600.16410 (winblue_gdr.130923-1706)'.
    It is actually at version '11.0.9600.16476' (which can be confirmed by using Explorer or by combining the File*Part
    properties as in previous posts).
    2. An Internet Explorer patch comes along that updates the file to '11.0.9600.16482' (something higher than 16476)
    3. I check the version of the file again using the VersionInfo.FileVersion property. It reports back '11.00.9600.16410
    (winblue_gdr.130923-1706)', which is the same thing it showed before the patch. The file is obviously different, but the FileVersion property is reporting that it hasn't changed.
    So, if you're using that property, you will miss file changes on a significant number of files. 'mshtml.dll' is just one example. Go back and read my example to get a list of DLLs
    from system32 that are affected by this (remember, you will get some false positives).
    If you're combining the File*Part properties (which is what both Bill and I do), then the version will always be in a known format, and then all of the stuff you said about not being
    able to compare them is simply not correct.
    So, how are you proposing that someone gets a file's version from PowerShell?

  • Get-Childitem with Get-FileHash Info

    Hello,
    I have been able run the following script to get File names in a Recurse folders, although I'm looking to use Get-Filehast too, although I'm not sure or unable to tag this on the end of this script File-filehast info.  could you advise.
    my current Get-Childitem script
    get-childitem'\\folder1\folder2\folder3'-recurse|
    Add-Member
    -MemberTypeScriptProperty-NameVersion-Value{
    $this
    .VersionInfo.ProductVersion
    -PassThru|
    select-object
    DirectoryName,Name,Version,LastWriteTime,Length|where{
    $_.DirectoryName
    -ne$NULL}

    Hi I'm outputting to a text file, which I'm then importing into a database, although I have the following objects
    of which I looking to get also hash (Algorithm SHA256) file values as well.  Thanks
    ( DirectoryName,Name,Version,LastWriteTime,Length
    my code is this & screen print from PowerShell
    get-childitem'\\ServerShare\Folder1\Folder2\FolderData'-recurse|
    Add-Member
    -MemberTypeScriptProperty-NameVersion-Value{
    $this
    .VersionInfo.ProductVersion
    -PassThru|
    select-object
    DirectoryName,Name,Version,LastWriteTime,Length|where{
    $_.DirectoryName
    -ne$NULL}
    |Export-Csv-PathC:\folder0\data1.txt
     

  • Get-Childitem with millions of files

    Hello all,
    My task is to create a report with all subfolders in a given path, sorted after the newest LastWriteTime on any file in the folder.
    The ultimate reason is to determine which folders have been unused for long enough to move to offline storage.
    So far I've come up with this:
    Get-ChildItem $folderpath | Where {$_.PsIsContainer} | foreach-object { Get-ChildItem $_ -Recurse -ErrorAction SilentlyContinue | Where {!$_.PsIsContainer} | Select Name,DirectoryName, LastWriteTime, Mode | Sort LastWriteTime -descending | select -first
    1}|export-csv $drive:\report.csv
    I know this works, I've tested it on a couple of folders.
    The problem is that the folder I really want to run the report for contains approximately 6.5 million files in many thousands of subfolders. Memory usage goes through the roof, server gets unresponsive, I have to kill the script before users get angry.
    I suppose that PowerShell tries to create an array in memory before actually piping and sorting, and that's the reason for the memory problem.
    Is there a smarter way to do it?

    It is all on 1 line, everything is going through the pipeline, it has to do each part of the pipeline before it`s gets to the next part of the pipeline.
    Do each each folder separately, here is a function to step through a folder structure recursively. Customize it for your needs. The maximum amount of resources used will be limited to one folder.
    function Recurse-Folders([string]$path) {
    Set-Location -Path $Path
    # $L = Get-Location
    # Do something at this location
    [String[]]$Folders = Get-ChildItem "." -Directory
    ForEach ($F in $Folders)
    Recurse-Folders($F)
    Set-Location -Path ".."

  • Get-childItem issue when sending mail

    I'm having a problem where the below command works but not the way it should. For example, if i have two files it will display both files in the email instead of just one. 
    $fname=Get-ChildItem \\Main\Drop| Where-Object {!$_.PSIsContainer}
    and here is the body of the email
    $Body = "Check Drop Folder for new file: `n $fname `n`nOR `nclick here: \\Main\Drop\$fname"
    If i have 2 files in that drop directory say: file1.txt, file2.txt the email will say:
    Check Drop Folder for new file:
    file1.txt file2.txt
    OR
    click here: \\main\Drop\file1.txt file2.txt
    I know its a simple fix but im missing it..

    The idea here is to get only ONE email PER FILE, i do not want to combine the files in one email. So for two files, i will have two emails. 
    Okay, here's a start:
    Get-ChildItem \\Main\Drop | ForEach {
    $body = "Check the drop folder for $($_.Name)"
    Send-MailMessage -To [email protected] -From [email protected] -Subject $body -Body $body -SmtpServer smtp.domain.com
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • APD with date variable in filter object

    Have an APD with a filter object. The filter uses a range for 0CALDAY. the range includes a variable (customer_exit) whic calculates the date of previous fiscal period-end date. Works perfectly in Bex.
    However, when running the APD, the date format comes out as YYYY/MM/DD, and 0CALDAY is expecting MM/DD/YYYY.
    How can I get the internal format of the date correct? I get no errors in the APD, however the date format causes incorrect results, as if no date was entered.
    Any suggestions?
    PS. actually, the internal date format used by the APD for my variable ZCE_PREVPER_END is:
    ZCE_PREVPER_END  = '20101001'
    Needs to be 10/01/2010....
    Edited by: JoeC on Oct 27, 2010 11:39 PM

    Hi Jordan,
    I would suggest several options.
    First, you have the option within Webi to display only the date and not the time (right click on the object on the report, or go to field properties, and change the format of the display).
    If you are using this value in comparisons in the report, you must make sure the format matches. Try changing the format within the variable to be the same as what you are comparing it to. If that is still not working, let me know. It may still just be a syntax or data type/format error.
    Thanks

  • XMLType in a an object returned by a stored procedure

    Hi,
    In my project, i'm using stored procedures defined by the schema's owner. Some of these procedures/functions return complex data (defined as objects in the database). This objects contains XMLTYPE data.
    When i call one of these stored procedures through JDBC, i've got an error ORA-01427. I watched when this exception is thrown and i found that appens when i do something like this :
    OPAQUE op = (OPAQUE)arr[1]; //the XMLTYPE in the STRUCT object returned by JDBC
    XMLType xt = oracle.xdb.XMLType.createXML ( op );
    I wanted to know what was the type of the object behind i get something like "class [B2".
    Anyone encoutered this problem?

    I forgot some precisions. This appens when i use a user who is not the owner of the schema. When i use the owner, everything is fine.

  • Using get -childitem to scan different drives but append one text file.

    Folks,
    I need some help, I wrote the below to scan for certain files types on client machines but I cant get the script to scan anything other than the C$. Apologies I am kind of new to scripting and PS. The script is kicked off using a batch file that makes the
    CR directory on the clients. I think the problem stems from the $disk variable or the way I have used foreach or the loop - any help would be appreciated
    Set-Location c:\
    $s = new-object -comObject SAPI.SPVoice
    $s.speak("Scan in progress")
    write-host "Scanning for files"
    $Extension = @("*.zip","*.rar","*.ppt","*.pdf")
    $Path = "$env:userprofile\Desktop"
    $disks = "c$","D$"
    foreach ($disks in $disks)
    {get-childitem -force -include $Extension -recurs -EA SilentlyContinue >$path\files.txt}
    $s.speak("Scan completed")
    Write-Host "Scan complete, files.txt created on your desktop - press any key to exit..."
    $x = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")
    Remove-Item c:\cr -recurse -EA SilentlyContinue
    exit

    Then there is "$x = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")" , What are you trying to do?
    It looks like that is a pause after the code has completed to give the user time to read the message prior to exiting.
    @V Sharma - As gaff-jakobs has mentioned, there are some parts of your code that need looked at. Please take a look at what he has advised and make the necessary changes. If you want to append data (doing a > does not append), I would look at using Out-File
    -Append -FilePath <filename> to accomplish this. 
    Usually, outputting to a text file limits what you can do with the output once it goes to a text file. I would look at using something such as Export-Csv -Append -Path instead (assuming you are running PowerShell V3). But if saving to a text file is part
    of your requirement, then just be sure to use the first method I mentioned.
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

Maybe you are looking for

  • How to trigger workflow for already created purchase order ?

    HELLO EXPERTS let me clear my scenario first . i have 1 purchase order whose workflow is not triggered . means it is showing me message no workflow that have already worked for this object.i have created 1 more purchase order taking reference of this

  • Can I add a second plot to an XY graph without having to re-draw the first?

    Hi, I'm trying to figure out a way to add a second plot (a linear fit between 2 cursors) to an XY graph without having to redraw the first plot (the underlying data). The reason this is important is that the first plot is typically hundreds of thousa

  • Passing table parameter from dynpro for java to sap r/3

    I am sending table parameter from WebDynpro to sap r/3,but the table is not populating.

  • Aironet 1300 - problems with security

    Hi, I have two Aironets setup as below. They both have the radio configured and up. I suspect the issue is with the security. I am unfamiliar with how it works - if anyone can provide me any pointers, it would be much appreciated! thanks, Mark dot11

  • HTTP to HTTP Through BPM?

    Dear All, please go through the below requirement and let me know your inputs and how do we develop this scenario in XI. Can this scenario be achieved by BPM. I have a Source System (AS400) and Target system (Windows) in between XI is lying. XI has t