Search found 15356 matches

by jvierra
Tue Jan 31, 2023 2:55 pm
Forum: PowerShell
Topic: script file "self destruct" on compiled EXE file
Replies: 1
Views: 228

Re: script file "self destruct" on compiled EXE file

No. The file you are running is in the EXE so that would make no sense. There would be no PS1 file in the folder. Why would you copy a PS1 and embed the same file into an EXE?
by jvierra
Sun Jan 29, 2023 2:49 pm
Forum: PowerShell
Topic: Tree folder/sub-folder/files archive issues...
Replies: 1
Views: 285

Re: Tree folder/sub-folder/files archive issues...

Pick one thing that doesn't work and let's try to understand what you are seeing. Just saying it doesn't work doesn't provide any useful information.

To scatter-add to an archive I suggest adding the files to an array then piping the array to "Compress-Archive".
by jvierra
Sat Jan 21, 2023 4:40 pm
Forum: PowerShell
Topic: Trouble Converting a multi-line string to a single line
Replies: 4
Views: 827

Re: Trouble Converting a multi-line string to a single line

Then you likely don't have an array.
by jvierra
Fri Jan 20, 2023 2:32 pm
Forum: PowerShell
Topic: Trouble Converting a multi-line string to a single line
Replies: 4
Views: 827

Re: Trouble Converting a multi-line string to a single line

To turn an array into a list do the following: $array -join '.' This will separate each element of the array into a comma separated list. I recommend taking some time to learn how to work with strings in PowerShell. The following free book will help you learn PowerShell basics. https://www.sapien.co...
by jvierra
Fri Jan 20, 2023 10:14 am
Forum: PowerShell
Topic: need help with regex
Replies: 3
Views: 261

Re: need help with regex

I see no way to solve your issue without changing code when you want to detect new languages. Try to rethink your process and question. Perhaps you will be able to clarify what you are trying to do.
by jvierra
Thu Jan 19, 2023 3:36 pm
Forum: PowerShell
Topic: need help with regex
Replies: 3
Views: 261

Re: need help with regex

Just detect the string language you want.
if ($line -match 'English'){
#do something
}else($line -match 'French')
}


Use one line for each language you need to detect. You can do this in a loop with an array of lines.
by jvierra
Tue Jan 17, 2023 9:57 am
Forum: PowerShell
Topic: Copy-Item copying folder and files but files are locked
Replies: 14
Views: 788

Re: Copy-Item copying folder and files but files are locked

Logging open handles for the folder and files would be the best way to proceed. This will tell you what process has opened and locked the files.
by jvierra
Mon Jan 16, 2023 6:52 pm
Forum: PowerShell
Topic: Copy-Item copying folder and files but files are locked
Replies: 14
Views: 788

Re: Copy-Item copying folder and files but files are locked

If the share is part of a replication set then this can happen on busy networks. I would start by restarting the server as things can get out of sync. The network techs should be advised as to this condition as they would know more about the configuration of the servers and any replication that may ...
by jvierra
Sat Jan 14, 2023 1:56 pm
Forum: PowerShell
Topic: expirate date to exe
Replies: 2
Views: 431

Re: expire date to exe

I am not sure what you are trying to ask but there is no "Expire Date" on Windows files.
by jvierra
Wed Dec 28, 2022 5:24 pm
Forum: PowerShell GUIs
Topic: context menu on Item in Listbox
Replies: 2
Views: 1125

Re: context menu on Item in Listbox

This is where to start. It will show you how the menu and the listbox can be set up so that menu events can act on the list item currently selected can be coded. https://info.sapien.com/index.php?option=com_content&view=article&id=28:spotlight-on-the-contextmenustrip-control&catid=26:gui...