home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 68,015 of 68,980   
   Robert Roland to dr.j.r.stockton@gmail.com   
   Re: I want a non-editing file display Wi   
   06 Mar 23 20:51:29   
   
   From: fake@ddress.no   
      
   On Mon, 6 Mar 2023 05:11:24 -0800 (PST), John Stockton   
    wrote:   
      
   >Interesting - I know little of PowerShell.   
      
   It is a bit of a learning curve at first, but it is well worth the   
   effort.   
      
   >Your second example does what I want, except that the selected lines are   
   shown (in a rather small font) but not executed.  A simple copy'n'paste seems   
   to fix the latter.   
      
   Unless I have misunderstood, that is exaxtly what you asked for.   
      
   As far is I know, there is no way to change the font size. I think it   
   might be inherited from Windows' general settings.   
      
   Since your text files contains both commands and file names, it gets   
   quite fiddly. The fact that RD and DEL are both internal commands does   
   not help.   
      
   If you could change your script so that the text file contains only   
   file names, simply pipe the result into Remove-Item:   
      
   powershell -command "Get-Content -Path %1|Out-GridView -OutputMode   
   Multiple|Remove-Item -WhatIf"   
      
   The "-WhatIf" causes the Remove-Item cmdlet to not do anything other   
   than saying what it would have done. Remove when you are ready to test   
   for real.   
      
   You can also add a title to the grid view if you want:   
      
   powershell -command "Get-Content -Path %1|Out-GridView -OutputMode   
   Multiple -Title 'Select files to delete:'|Remove-Item -WhatIf"   
      
   >I need to find Powershell  and Out-GridView reference material.   
      
   In a PowerShell prompt, simply enter:   
      
   Get-Help -Name Out-GridView -Full   
   --   
   RoRo   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca