please disregard this post.
i somehow selected Microsoft Windows Powershell (commandline) instead of SAPIEN PowerShell V5 Host ( Commandline ) when compiling the scripts. there is a big difference as it seems many features does not work that way.
Search found 75 matches
- Tue May 02, 2023 6:53 am
- Forum: PowerShell
- Topic: Silent switch not working
- Replies: 1
- Views: 1797
- Tue May 02, 2023 6:32 am
- Forum: PowerShell
- Topic: Silent switch not working
- Replies: 1
- Views: 1797
Silent switch not working
Hello
i upgraded to latest 5.8.221 build. I created simple script and added support for switches : $silentswitch = $Commandline.ToLower()
when i compile script, silent switches no longer works. older versions worked just fine. do you know if something changed ?
i upgraded to latest 5.8.221 build. I created simple script and added support for switches : $silentswitch = $Commandline.ToLower()
when i compile script, silent switches no longer works. older versions worked just fine. do you know if something changed ?
- Wed Dec 07, 2022 11:35 pm
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Re: Service script that stops itself
i needed to create process to detect if PC is connected to the internet. this can run for a day or for a month. Then force PC to sync time and then terminate itself. It should not be visible as script running in the background either. These were requirements from customer. Service is convenient, as ...
- Wed Dec 07, 2022 12:22 pm
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Re: Service script that stops itself
thank you. i understand - it wasnt built for sole purpose. SO basically it should be shutdown and closed from outside.
- Wed Dec 07, 2022 8:58 am
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Re: Service script that stops itself
hmm. The only thing i did was to call stop-myservice directly in the end of main function. this is how its done ( simplified version ). is that not a proper way ? i only found documentation to old service process function Invoke-MyService { $global:bServiceRunning = $true while ($global:bRunService)...
- Wed Dec 07, 2022 8:34 am
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Re: Service script that stops itself
hi Alexander. Are you sure ?
that is exactly what i am calling but service will not stop. it will execute what is inside but does not stop. At least not for my version that is PSStudio 208
that is exactly what i am calling but service will not stop. it will execute what is inside but does not stop. At least not for my version that is PSStudio 208
- Wed Dec 07, 2022 8:10 am
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Re: Service script that stops itself
okay i figured it out. i need to first change startup type to disabled, otherwise when it is on Auto, it will auto start and freez in loop. If somebody needs it. this is what worked for me Get-Service 'TimeSync' | Set-Service -StartupType Disabled reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersi...
- Wed Dec 07, 2022 7:47 am
- Forum: PowerShell
- Topic: Service script that stops itself
- Replies: 9
- Views: 1202
Service script that stops itself
Hello. is it possible to properly stop and uninstall powershell service by itself ? not sure what i did wrong, but my service always hangs on Stopping ( stop Pending ) . i also tried to add uninstaller for itself, but that does not work either. Other method i tried was to call external script that w...
- Wed Apr 27, 2022 1:57 am
- Forum: PowerShell Studio
- Topic: Odd Quotes behavior
- Replies: 3
- Views: 2280
Re: Odd Quotes behavior
thank you, i cannot reproduce this issue in version 205
- Tue Apr 26, 2022 12:41 pm
- Forum: PowerShell Studio
- Topic: Odd Quotes behavior
- Replies: 3
- Views: 2280
Re: Odd Quotes behavior
sorry, unfortunately i found this behaviour for almost everything i use, not just quotes. {}, (), [] are affected as well. i cry now during coding :'-(