AppVeyor Environment check added before writing file to disk.