Create a Vyos Router VM in Hyper-V for Labs 13

UPDATE 2016-12-28: Updated for latest Vyos 1.1.7 and again a view little script tweaks. I play a lot with VMs and I wanted a small virtual router to allow internet access for my Labs. After some searching I found Vyos and created  a few scripts to automate the router installation. The result will be a router only consuming 256MB and offering DNS, DHCP and NAT to 5 different subnets. If you want you can extend or change the subnets as much as you want. These are the steps I followed: Download Vyos: http://packages.vyos.net/iso/release/1.1.7/vyos-1.1.7-amd64.iso and put it in D:\ISO. If you put ISO somewhere else, change the location in the script. Open Powershell ISE as Administrator and ...

Install Hyper-V on a Virtual Machine in Hyper-V 1

If you want to install Hyper-V on a Virtual Machine the following error message will appear: ” Hyper-V cannot be installed: A Hypervisor is already running”. But it’s possible with PowerShell although you will not be able to run a virtual machine in the virtual machine. Open a PowerShell console as administrator in the virtual machine where you want Hyper-V installed. Type te following commands: Set-ExecutionPolicy RemoteSigned Enable-WindowsOptionalFeature –Online -FeatureName Microsoft-Hyper-V –All -NoRestart Install-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature Restart-Computer Now Hyper-V is installed for testing purposes, but running a Virtual Machine in a Virtual Machine will not be possible. Tweet

Powershell – Send Mail Message with Multiple Attachments

I have a server where I create a certain type of files that I have to send by email on a daily basis to the same email receiver. Sending an email with Powershell is not complicated, just use Send-MailMessage. But since I had to do this a lot, I decided to create a function to do this job including a search window to find and attach the file. I added the following function to my PowerShell profile: #Send email with Attachment(s) Function Send-CustomMailMessage { [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $FileLocation = New-Object System.Windows.Forms.OpenFileDialog $FileLocation.initialDirectory = 'd:\' #Or any other location $FileLocation.Multiselect = $true $Dialog = $FileLocation.ShowDialog() If ($Dialog -eq 'Cancel') { Return #End Function ...

My PowerShell Profile Configuration

UPDATE 20131028: Added snap-in registration I thought it would be nice to share my PowerShell profile settings as a starter for new users. It’s rather basic, I only added a few things to make my PowerShell console ready from the start. But first some easy tips to check and if needed create a profile. Test if you have a PowerShell Profile. Start Powershell and type: Test-Path $PROFILE If the result is “False” you don’t have a PowerShell profile. Let’s create one: New-Item -Path $PROFILE -Type File -Force This will create an empty profile. Now we can edit the profile file: Notepad $PROFILE In this profile I’ve put in the following things: ...