Search found 15354 matches
- Sat Jan 21, 2023 4:40 pm
- Forum: PowerShell
- Topic: Trouble Converting a multi-line string to a single line
- Replies: 4
- Views: 722
Re: Trouble Converting a multi-line string to a single line
Then you likely don't have an array.
- Fri Jan 20, 2023 2:32 pm
- Forum: PowerShell
- Topic: Trouble Converting a multi-line string to a single line
- Replies: 4
- Views: 722
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...
- Fri Jan 20, 2023 10:14 am
- Forum: PowerShell
- Topic: need help with regex
- Replies: 3
- Views: 214
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.
- Thu Jan 19, 2023 3:36 pm
- Forum: PowerShell
- Topic: need help with regex
- Replies: 3
- Views: 214
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.
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.
- Tue Jan 17, 2023 9:57 am
- Forum: PowerShell
- Topic: Copy-Item copying folder and files but files are locked
- Replies: 14
- Views: 681
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.
- Mon Jan 16, 2023 6:52 pm
- Forum: PowerShell
- Topic: Copy-Item copying folder and files but files are locked
- Replies: 14
- Views: 681
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 ...
- Sat Jan 14, 2023 1:56 pm
- Forum: PowerShell
- Topic: expirate date to exe
- Replies: 2
- Views: 388
Re: expire date to exe
I am not sure what you are trying to ask but there is no "Expire Date" on Windows files.
- Wed Dec 28, 2022 5:24 pm
- Forum: PowerShell GUIs
- Topic: context menu on Item in Listbox
- Replies: 2
- Views: 1081
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...
- Thu Dec 22, 2022 11:03 pm
- Forum: PowerShell GUIs
- Topic: issue with get-variable
- Replies: 5
- Views: 1085
Re: issue with get-variable
I had some time, so I built a small demo of how to add and remove tabs. Note that there is only on temporary variable, and it create a new tab or display the tab associated with the name in the text box. Change the name and create a couple of new tabs and then type in the name of an existing tab and...
- Thu Dec 22, 2022 4:14 pm
- Forum: PowerShell GUIs
- Topic: Floating toolbar
- Replies: 6
- Views: 224
Re: Floating toolbar
Wow! Is that confusing. I can see why you are stuck. You cannot have two modal dialogs on the screen at the same time and have both active. The last guy up controls everything and the first form can do nothing. PowerShell has only one thread so it can execute only one line of code at a time or one s...