Can you configure LibreOffice with PowerShell? - powershell

I'm coming here today as a newbie, I want to create a script that'll save me time when setting up a fresh Windows Installation, so it'll start with an Invoke-Webrequest to download the desired application (like LibreOffice) from Ninite.
The question is can I configure them with PowerShell ? Example: You can configure LibreOffice to save your files with the extension .docx instead of .odt.
Is it possible to configure that from PowerShell ?
If so, can you tell me ?
Thanks !

Related

I have downloaded pyaudio.whl but instead of running through powershell or cmd , I have used open with other apps

I have downloaded pyaudio.whl but instead of running through powershell or cmd , I have used open with other apps. I tried alot to reverse it in original format but unable to so. now whatever .whl file am downloading its always downloading with other format. Please help to get it reverse in original format so I can run it through cmd.

Copying files from Unix to Windows based on parameter

I run some control-m jobs which generate files and places in UNIX box under various folders.
These files need to be sent to different users who don't have access to the system.
Each time, I have to copy these files from the Unix folder (based on which control-m job was run) to my local directory and then send those to the users.
I am looking for a way to automate this. I want to create an interface where users can specify parameters (Job names), which in turn will copy the file from the particular folder on Unix to a location user has to access to.
The way I think I might have to approach this problem is -
Share a directory on any Windows virtual machine which everyone has access to. (This will be my landing zone)
Create a script which transfers files from various folders on Unix to Windows directory, based on the parameters that are being passed.
Create an HTA interface where users can specify parameters, which in turn will trigger the script and transfer the file, user is looking for, to windows directory
I am not a programmer but I would like to develop something which will make everyone's life easier.
Could someone please advise if this approach is correct or if this can be achieved in a better way.
Moreover, which language will be a good choice to write this script in. I know a bit of shell scripting and PowerShell. Willing to learn anything else if that solves my problem.
Please advise.
Here is one solution:
Obtain empty Windows server
Install chocolatey
cinst winscp (to copy files)
Use https://github.com/tomohulk/WinSCP to automate file copy via posh script. Provide adequate parameters for it.
cinst rundeck --params /Service to provide graphical interface for users in web
Manually create rundeck job and expose parameters for users so they have nice web GUI. You can let users specify folder or let them choose from the list.

Copy files from SFTP with CMD

We have a customer with their SFTP site, and I would like to copy files from specific folder, by using any automated process.
One of the example which I found, is winscp.net, but I have not managed how to use it, for my purpose.
http://www.itworld.com/article/2928599/windows/how-to-automate-sftp-file-transfers-in-microsoft-windows.html
QUESTION: All I will need is not run script and the file should be copied from their directory to my local folder. Is it possible at all?
I found the way of using PSFTP(Putty) to connect to the server, but how to make it automatically, do not know.
I think its a good solution for your problem.
You have to install winscp and the code some files and it will do automaticaly. I used 3 or 4 times. Also you need the key for your SFTP to connect throught it.
Here a link to the guide step by step.
https://winscp.net/eng/docs/guides
Here is a link to the scripting webpage
https://winscp.net/eng/docs/scripting
I recommend you to create an ini file to load all of the characteristics of your ftp connection and then execute an script over this.
It can be launched like that
WinSCP.com /ini=[your ini file] /script=[Your script file(what you want to do when it is connect)]
Hope this helps!.

Virus-scan file with Powershell

Is it possible to trigger a virus scan on a file with PowerShell?
We want to search a file for virus, and if the file is ok; move the file to another directory..
We have thought about setting up a dedicated server for this with some software for the virus-search, but we have no clue on where to begin, or if it's even possible. I'm open for suggestions. Thanks.
You can use PowerShell to automate the job. However the choice of antivirus application is up to you. As #Joachim already suggested, you may want to try ClamAV which is under GPL.

Deploy an hta file in an exe or msi file

I've written an HTA file frontend for our web app that allows the web app to run without web browser status bars etc, and allows it to access the local system for certain tasks.
I need a way to deploy this to customers. I need an installer to supply an hta file, an ico file, and add a link to them in the start menu and on the users desktop. I looked at building an installer with NSIS, but I couldn't figure out how to assign the icon to the shortcuts - The icon had to be a standard HTA one.
Can this be done with NSIS, or should I be using another installer?
P.s. I've got no particular preference for NSIS, it's just something I once used a very long time ago. When I download stuff, I think I prefer them to be msi files that launch with windows installer (it feels more like downloading a .rpm or .deb on linux which I am used to) but I know nothing about how those are created. I'm a web/linux guy who knows very little about windows programming.
Check out the NSIS Scripting Reference for CreateShortcut. You should be able to do something like this:
SetOutPath $DESKTOP
CreateShortcut "$DESKTOP\MyShortcut.lnk" "$INSTDIR\MyHTAFile.hta" "" "$INSTDIR\MyIconFile.ico"