Only a part of an array is choosed

Hi Guys!
I've got  an array only a part of this array is choosed  but i want to choose all the array:
The code:
function Move-EmptyDir{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$Source,
[Parameter(Mandatory = $true)][string]$Destination,
[ValidateNotNullOrEmpty()][regex]$NoMatch
$EmptyFolders=@()
$AllFolders= (Dir $Source -Force -Recurse) | Where-Object{$_.Attributes -match "Directory"}
$ExistFolders= $AllFolders | Group-Object -Property Exists | Where-Object{$_.Name -match "True"} #verify
$Inexisting= $AllFolders | Group-Object -Property Exists | Where-Object{$_.Name -match "False"}
if($Inexisting.Count -gt 0){
ForEach($Not in $Inexisting){
Write-Warning "The Folder $Not is not existing"
Foreach($Item in $ExistFolders.Group){
$MeltinCount= $Item.GetFileSystemInfos().count #0= no element(s)
$SimCount= (($ExistFolders.Group | Group-Object -Property Parent) | Where-Object{$_.Name -eq $Item.Name}).Count #0=no subfolders
if($MeltinCount -eq $SimCount){
$EmptyFolders+= $Item
else{
Write-Warning "The Folder $Item is have file(s)"
$Moved= @()
$Moving= $EmptyFolders.Length -1
While($Moving -ne -1){
$OneFolder= $EmptyFolders[$Moving] #<---------Maybe the problem is near here
Write-Host $OneFolder.name -BackgroundColor Red
if($OneFolder.GetFileSystemInfos().count -gt 0){ #Parent have some directory(but 0 files)
Write-Warning "This Folder $OneFolder is not empty"
$Moving--
elseif($OneFolder.Name -match $NoMatch){
Write-Warning "The Folder $OneFolder Match the Exceptions"
$Moving--
else{
if($OneFolder.parent.Name -match $NoMatch){
Write-Host "The Parent Folder of $OneFolder Match the Exceptions" -BackgroundColor Green
$Moved += $OneFolder
$Place = $OneFolder.FullName -replace "^$([regex]::Escape($Source))", $Destination
if((Test-Path $Place) -eq $false){
New-Item -Path $Place -ItemType Directory
Remove-Item -Path $OneFolder.fullname -Force -ErrorAction SilentlyContinue
Write-Verbose ('Moved folder "{0}" to "{1}"' -f $OneFolder.FullName, $Place)
$Moving --
else{
Remove-Item -Path $OneFolder.FullName -Force -ErrorAction SilentlyContinue
$Moving --
$Where= 'C:\temp'
$ToGo= 'C:\estinto'
$MatchList= '0','1','8','9','Scansion'
$Kind= 'Empty'
if(Test-Path $Where){
#$TheMatch = Select-Match -FullList $MatchList
$Folders = Move-EmptyDir -Source $Where -Destination $ToGo -NoMatch 'F' -Verbose
$Drives = ForEach($Item in $Folders){
Select-Object -Property @(
@{ Name = 'Name'; Expression = { $Item.Name } }
@{ Name = 'Percorso'; Expression = { $Item.Parent.FullName } }
#$Drives
#Get-Report $Drives $Kind
else{
Write-Error 'Invalid Path' -Category ResourceUnavailable
My folder structure Temp>F1>F2>F3>E4 & Temp>G1>G2 F1& G1 have files, F2 have only F3,F3 have only E4, E4& G2 empty
Please create this structure and run the code one time: E4 is not choosed
Thanks

I do not use ISE much myself, but it seems to me that others have reported problems here that resulted from variables from an earlier run remaining in existence when a script is re-run when ISE was used.
Of course, that would appear to be only part of your problem, as, ideally, the script should be able to find all empty folders when run only once.
One thing you could do that might help would be to display all variables before the first run, between the two runs, and after the second run. When you see what values are contained after the first run, this might give a clue as to why or how the script
seems to manage to get farther on the second try.
This sounds like it may possibly be a one-off situation. Although "F" precedes "G" alphabetically, the file/folder system is not necessarily maintained in alphabetical order. If the "G" folders are processed before the "F" folders, then it seems likely that
F4 is the very last folder processed. Perhaps it is being processed correctly, but the results are just not being properly recorded.
Let us know how you get along with this.
Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

Similar Messages

  • Read part of an array element

    Hello All.
    As indicated in the title, I am trying to read part of an array element.
    What I'm doing is reading values from a LeCroy scope using a "write" than "read" I have returned the read values into an array but the issue is the scope returns a value "1, 52.33E-3"
    I simply want the element to be 52.33 that way I can use that for other calculations.
    For example my array is.
    "1, 34.334E-3"
    "1, 53.343E-3"
    "1, 143.232E-"
    And I want it to be
    34.334
    53.343
    143.232
    Thanks!
    Solved!
    Go to Solution.

    Another option is to use Spreadsheet String to Array and use the comma as the delimiter.  It can actually change your string into an array of numbers.  Then you just index out the number you want.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I delete only one part of my xml file?

    Hello,
    I stored more than 100 users in only one xmltype column. For instance
    Create table agro(users XMLTYPE);
    ... and I inserted all users inside
    INSERT INTO agro values(XMLTYPE
    ('<?xml version="1.0" encoding="ISO-8859-1"?>
    <authentication><users><user>
    <name>cocoon</name>
    <password>cocoon</password>
    <role>admin</role>
    <title>Mr.</title>
    <firstname>Walter</firstname>
    <lastname>Cocoon</lastname>
    <company />
    <street />
    <zipcode />
    <city />
    <country>DE</country>
    <phone />
    <fax />
    <email />
    <bankid />
    <bankname />
    <accountid />
    </user>
    ... another user, etc.
    </users></authentication>'));
    Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
    I used for this target the following statement:
    DELETE FROM agro agro
    WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
    When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
    How can I delete only one part of my xml file?
    Kind Regards
    M R

    This the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
    In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
    If you store each user document as a seperate document then your delete will work as expected.

  • Is it possible to update only a part of my apps

    Hi, I would like to upgrade my apps, but my iPad2 writes that I don't have enough memory. Is it possible to upgrade only a part of the apps? In the appstore, you can chose either all of them or nothing.
    Thank you!

    You can update all, or download select App updates one at a time by selecting the app update you want to install.

  • Is it possible to share only a part of contact.

    Hi,
    Is it possible to share only a part of an contact? For example: If you have more nubmers and data for one contact (mostly we do) and would like to send someone only one number and not the rest of contact`s data (personal)? I know that on some other phones this is possible. Thanks for answers.

    You can update all, or download select App updates one at a time by selecting the app update you want to install.

  • Accounts can only be part of one Family at a time.

    I just upgraded my Mac Book Pro to Yosemite and get the following error when trying to start up Family Sharing
    {my appleID} "is used for sharing purchases in another Family. Accounts can only be part of one Family at a time."  I'm not sure what that means or how to fix it.  I'm only part of one family!  I get the same error message trying to start up Family Sharing on my iPhone and iPad.

    Hello Bill,
    Did you find a way to resolve this problem?
    I have the same issue...

  • When saving my illustrator file to a pdf it doesnt show all the artwork ie boxes are hidden in the pdf or only showing part of them. How can I fix this?

    when saving my illustrator file to a pdf it doesnt show all the artwork ie boxes are hidden in the pdf or only showing part of them. Even some text is hidden. I have flattened the artwork so everything is in one layer. How can I fix this?

    Hi John
    I have indicated on the attached jpeg where the problem is, basically a line of text is missing at the top and part of the feeding diagram is missing. I created the artwork in different layer and then flattened. All text has been converted to outlines, however the areas being affected have no transparency, I have used solid fills or no fills. I get the same result when I export the file as a jpeg. Hope you can help.

  • Hi, I have problem with importing MOV files from SJCAM 4000. MOV files are in supported formats for Adobe Premiere Elements 11. But if I'm importing MOV file, only audio part is imported, video part is not imported. How can I solve this problem?

    Hi, I have problem with importing MOV files from SJCAM 4000. MOV files are in supported formats for Adobe Premiere Elements 11. But if I'm importing MOV file, only audio part is imported, video part is not imported. How can I solve this problem?

    haben
    From looking at the specifications of your camera (SJCam 4000), we know already what video compression your camera is using. It is H.264.
    A H.264.mov file should be supported by Premiere Elements 11. On what computer operating system is your Premiere Elements 11 running?
    Do you have the latest version of QuickTime installed on your computer? And, are you running QuickTime and Premiere Elements 11 from a
    User Account with administrative privileges? Please go to Premiere Elements 11 Publish+Share/Computer/QuickTime to confirm that you find
    presets there for the QuickTime choice there.
    What are the properties of these H.264.mov files - is it 1080p30 (1920 x 1080p30)  or something else? Do you know if this camera is recording with a variable or
    a constant frame rate?
    Please review and consider and then we will decide what next.
    Thank you.
    ATR

  • I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if I

    I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info/start time and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if If I change the start time on one it will change it on all of them.

    In your library, right-click the song you want to edit.
    select "get info".
    go to "options" and select the start and stop times for your first section of the song.
    click "OK".
    Find the shortened version of the song in your library. It may take a minute for it to show up. right click it again and select "create (????) version". (the ???? is different for different formats).
    The library will spit out a new, second version of the song which you can rename. I suggest you use the original title and add a 1 to the end.
    Now you can go back to the other version and repeat the process with a different  start/stop time.
    Once you are done editing, you can burn all of your versions to a disk, just make sure your interval time is zero so there are no gaps between edits.
    To keep the orginal song on your library, just go back to the original and put the start/stop times back to the original settings.

  • Program monitor only showing part of clip.

    Hi
    My program monitor only shows part of a clip during playback, though output to an external monitor is fine. If I stop playback and click in the monitor window, the clip is displayed correctly, but reverts back to partial when playing back.
    This started happening today after installing Matrox tools update to 5.1 and latest matrox effect patterns.  Everything else is perfect inc source monitor.
    Have tried may settings changes, new projects old projects, new clips etc etc but its the same every time.  Any ideas what has gone wrong? Its been running perfect for last 4 years.  Is it worth reinstalling CS5 and would I have to reinstall Matrox also?
    Windows 7 system 64 bit;  2 x 2,66 quad xeon processors;  4Gb ram;
    ATI 4670 512mb graphics card;
    Prem Pro CS5
    Matrox RT.X2
    Many thanks

    Hi
    My program monitor only shows part of a clip during playback, though output to an external monitor is fine. If I stop playback and click in the monitor window, the clip is displayed correctly, but reverts back to partial when playing back.
    This started happening today after installing Matrox tools update to 5.1 and latest matrox effect patterns.  Everything else is perfect inc source monitor.
    Have tried may settings changes, new projects old projects, new clips etc etc but its the same every time.  Any ideas what has gone wrong? Its been running perfect for last 4 years.  Is it worth reinstalling CS5 and would I have to reinstall Matrox also?
    Windows 7 system 64 bit;  2 x 2,66 quad xeon processors;  4Gb ram;
    ATI 4670 512mb graphics card;
    Prem Pro CS5
    Matrox RT.X2
    Many thanks

  • Only prints part of photo

    I am trying to print a 12x16 in photo from iPhoto using an Epson 1280 printer. Unfortunately, the printer only prints part (about 1/4 of the photo). It then ejects the photo paper as if it were finished with the print job. I downloaded the latest driver from the Epson website. I also tried deleting the .plist file in the Library folder (I ended up restoring it because the next time I launched iPhoto, almost all of my photos were missing). Finally, I also tried creating and printing from a new user account. The only thing that seemed to work was when I tried printing an 8x10 of the same photo (to save ink, I printed it in B/w rather than color, though I can't imagine that made a difference). Incidentally, I had the same problem once before and managed to solve it. Unfortunately, I can't remember how -- my best recollection is that it had something to do with drivers and/or Library files. Any help would be greatly appreciated.

    Heather:
    The problem is that the Epson 1280 does not support 12x16 borderless prints. From the Epson site:
    "It produces captivating borderless 4" x 6", 5" x 7", 8" x 10", letter (8.5" x 11"), 11" x 14" and 13" x 19" color photos"
    If you don't need borderless select the paper size that the printer supports that will hold that size print and select a custom sized print in the Print window. It should print in the center of the paper used.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: The new rebuild option in iPhoto 09 (v. 8.0.2), Rebuild the iPhoto Library Database from automatic backup" makes this tip obsolete.

  • How come itunes only downloaded part of a song?

    I bought a a couple of albums off of itunes and on one song (that i know of) on each album only plays part of the song. For example: if you have a 3:45 song it will only play 2:35 of the song and then it cuts off and moves onto the next song on the album. Can anybody help with this problem. I want my moneys worth. Thanks.

    Delete the tracks from the iTunes library, allowing iTunes to move the track files to the Trash. Then download the tracks again from the iTunes Store via this procedure:
    http://support.apple.com/kb/ht2519
    That fixes the problem for many people. If problems with the tracks persist, go here:
    iTunes Support
    and follow the instructions to report the issue to the iTunes Store.
    Regards.

  • TS1424 itunes only downloaded part of a song I purchased. How do I correct that?

    itunes only downloaded part of a song I purchased. How do I fix it or get a refund?

    Other people have been having similar problems with songs for a few days, I assume that there has been a problem with Apple's servers.
    Depending upon what country that you are in (music can't be re-downloaded in all countries) then try deleting it from your iTunes library and redownload it via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes : re-downloading.
    If you aren't in a country where you can re-download music or if it re-downloads in the same state then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that song and use the 'Report a Problem' link.

  • My iPhone 4S is only playing part of a song and then stops, sometimes plays whole song but for the most part it just stops randomly

    My iPhone 4S is only playing part of a song and then stops, sometimes plays whole song but for the most part it just stops randomly

    Now it's Wednesday (2 days since I originally posted) & my iPhone appears to have finally restored all my apps, but it still says it's restoring from iCloud backup.  If all my apps are restored, what else could it be restoring?  IS it actually restoring anything at this point, or is it still in 'glitch' mode???  I've tried turning it off & back on & it continues to say that it's restoring.

  • I have just synced my iphone4 it has only synced part of my music not all of it saying they can't be found although they are in my library

    i have just synced my iphone4 but it has only synced part vof my library saying it cant find songs.

    You can turn off in-app purchases on the iPad via Settings > General > Restrictions > In-App Purchases 'off' - depending upon the iOS version on the iPad you might also have a Require Password setting on the Restrictions screen which you can set to 'Immediately'
    There is a copy of the iPad manual here, which you can download : http://support.apple.com/manuals/ipad/
    And more info about restrictions : http://support.apple.com/kb/HT4213

Maybe you are looking for

  • Data not getting displayed in controls present in the tabs

    Hi, I am facing problem in binding data to different controls exisiting in different tabs of a page from database. I can see the values of the controls in first tab, but not in other tabs. And at the same time, I can get the values of the datagrid ev

  • Flickering - radeon, awesome, xterm

    Hi! I'm setting up Arch on my notebook and I have problems with flickering. The config is very basic - just Xorg, open source Radeon driver and awesome wm. When rearranging xterm windows using awesome they flicker and they are redrawn slowly. It take

  • To create a desktop shortcut icon for the application for a jar file

    Hi I have created a jar file for my application. when i double click this jar file, the application opens. What i want is-- Instead of user clicking on the jar file, my application also has to create a desktop shortcut icon. If the user clicks on the

  • RFC to XI not working

    Hello, I have created a program that calls a RFC function and sends de result to XI server. I've done that exactly how that blog tells: /people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous I've configured and tested SM59 RF

  • Applications background color changes after sometime

    Hi All, We have an R12.1.1 instance on solaris and we are facing a strange problem. The background color of the application changes to blue suddenly and the Users are not able to properly see the links which are in blue. If we bounce Apache, it comes