Repository: kubernetes/minikube
Pull request #12397 (2021-09-02 23:04:42)

Update Windows Install PowerShell Commands
Updated the Windows install commands to use all native PowerShell cmdlets. Thus no longer requiring `curl` as a prerequisite. 

FWIW, in PowerShell, `curl` is an alias for `Invoke-WebRequest` so passing `-Lo` parameters to it will cause errors unless the real `curl` is installed.

```powershell
PS C:\> Get-Alias curl

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           curl -> Invoke-WebRequest
```



Patch:
diff --git a/pkg/minikube/out/out.go b/pkg/minikube/out/out.go
index 01dd5318d..4706f9a70 100644
--- a/pkg/minikube/out/out.go
+++ b/pkg/minikube/out/out.go
@@ -33,9 +33,9 @@ import (
 	"github.com/Delta456/box-cli-maker/v2"
 	"github.com/briandowns/spinner"
 	"github.com/mattn/go-isatty"
-	"github.com/spf13/pflag"
 
 	"k8s.io/klog/v2"
+	"k8s.io/minikube/pkg/minikube/localpath"
 	"k8s.io/minikube/pkg/minikube/out/register"
 	"k8s.io/minikube/pkg/minikube/style"
 	"k8s.io/minikube/pkg/minikube/translate"
@@ -381,6 +381,14 @@ func displayError(msg string, err error) {
 }
 
 func latestLogFilePath() (string, error) {
+	if len(os.Args) < 2 {
+		return "", fmt.Errorf("unable to detect command")
+	}
+	cmd := os.Args[1]
+	if cmd == "start" {
+		return localpath.LastStartLog(), nil
+	}
+
 	tmpdir := os.TempDir()
 	files, err := ioutil.ReadDir(tmpdir)
 	if err != nil {
@@ -403,32 +411,16 @@ func latestLogFilePath() (string, error) {
 	return fullPath, nil
 }
 
-func command() (string, error) {
-	if len(pflag.Args()) < 1 {
-		return "", fmt.Errorf("unable to detect command")
-	}
-
-	return pflag.Arg(0), nil
-}
-
 func displayGitHubIssueMessage() {
-	cmd, err := command()
+	logPath, err := latestLogFilePath()
 	if err != nil {
-		klog.Warningf("failed to get command: %v", err)
+		klog.Warningf("failed to diplay GitHub issue message: %v", err)
 	}
 
 	msg := Sprintf(style.Sad, "If the above advice does not help, please let us know:")
 	msg += Sprintf(style.URL, "https://github.com/kubernetes/minikube/issues/new/choose\n")
-	msg += Sprintf(style.Empty, "Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.")
-
-	if cmd != "start" {
-		logPath, err := latestLogFilePath()
-		if err != nil {
-			klog.Warningf("failed to get latest log file path: %v", err)
-		}
-		msg += Sprintf(style.Empty, "Please also attach the following file to the GitHub issue:")
-		msg += Sprintf(style.Empty, "- {{.logPath}}", V{"logPath": logPath})
-	}
+	msg += Sprintf(style.Empty, "Please attach the following file to the GitHub issue:")
+	msg += Sprintf(style.Empty, "- {{.logPath}}", V{"logPath": logPath})
 
 	BoxedErr(msg)
 }
diff --git a/site/content/en/docs/start/_index.md b/site/content/en/docs/start/_index.md
index 59174dd80..6922b0bef 100644
--- a/site/content/en/docs/start/_index.md
+++ b/site/content/en/docs/start/_index.md
@@ -425,20 +425,19 @@ choco install minikube
 {{% quiz_instruction id="/Windows/x86-64/Stable/.exe download" %}}
 1. Download the [latest release](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe).  
 <br>
-    Or if you have `curl` installed, use this command:
-    ```shell
-    curl -Lo minikube.exe https://github.com/kubernetes/minikube/releases/latest/download/minikube-windows-amd64.exe
-    New-Item -Path "c:\" -Name "minikube" -ItemType "directory" -Force
-    Move-Item .\minikube.exe c:\minikube\minikube.exe -Force
+    Or if using `PowerShell`, use this command:
+    ```powershell
+    New-Item -Path 'c:\' -Name 'minikube' -ItemType Directory -Force
+    Invoke-WebRequest -OutFile 'c:\minikube\minikube.exe' -Uri 'https://github.com/kubernetes/minikube/releases/latest/download/minikube-windows-amd64.exe' -UseBasicParsing
     ```
 
 2. Add the binary in to your `PATH`.  
 <br>
     _Make sure to run PowerShell as Administrator._
-    ```shell
-    $oldpath=[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
-    if($oldpath -notlike "*;C:\minikube*"){`
-      [Environment]::SetEnvironmentVariable("Path", $oldpath+";C:\minikube", [EnvironmentVariableTarget]::Machine)`
+    ```powershell
+    $oldPath = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)
+    if ($oldPath.Split(';') -inotcontains 'C:\minikube'){ `
+      [Environment]::SetEnvironmentVariable('Path', $('{0};C:\minikube' -f $oldPath), [EnvironmentVariableTarget]::Machine) `
     }
     ```
     _If you used a CLI to perform the installation, you will need to close that CLI and open a new one before proceeding._
@@ -447,22 +446,22 @@ choco install minikube
 {{% quiz_instruction id="/Windows/x86-64/Beta/.exe download" %}}
 1. Download the <a href="#" id="latest-beta-download-link">latest beta release</a>.  
 <br>
-    Or if you have `curl` installed, use this command:
-    ```shell
-    $r='https://api.github.com/repos/kubernetes/minikube/releases'
-    $u=curl -s $r | Select-String -Pattern 'http.*download/v.*beta.*/minikube-windows-amd64.exe' | Select Matches -First 1
-    curl -Lo minikube.exe $u.Matches.Value
-    New-Item -Path "c:\" -Name "minikube" -ItemType "directory" -Force
-    Move-Item .\minikube.exe c:\minikube\minikube.exe -Force
+    Or if using `PowerShell`, use this command:
+    ```powershell
+    New-Item -Path 'c:\' -Name 'minikube' -ItemType Directory -Force
+    $response = Invoke-WebRequest -Uri 'https://api.github.com/repos/kubernetes/minikube/releases' -UseBasicParsing
+    $json = $response.Content | ConvertFrom-Json
+    $item = ($json | ?{ $_.prerelease -eq $true })[0].assets | ?{ $_.name -eq 'minikube-windows-amd64.exe' }
+    Invoke-WebRequest -Uri $item.browser_download_url -OutFile 'c:\minikube\minikube.exe' -UseBasicParsing
     ```
 
 2. Add the binary in to your `PATH`.  
 <br>
     _Make sure to run PowerShell as Administrator._
-    ```shell
-    $oldpath=[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
-    if($oldpath -notlike "*;C:\minikube*"){`
-      [Environment]::SetEnvironmentVariable("Path", $oldpath+";C:\minikube", [EnvironmentVariableTarget]::Machine)`
+    ```powershell
+    $oldPath = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine)
+    if ($oldPath.Split(';') -inotcontains 'C:\minikube'){ `
+      [Environment]::SetEnvironmentVariable('Path', $('{0};C:\minikube' -f $oldPath), [EnvironmentVariableTarget]::Machine) `
     }
     ```
     _If you used a CLI to perform the installation, you will need to close that CLI and open a new one before proceeding._
diff --git a/translations/de.json b/translations/de.json
index 478dc10a5..4c52b30ad 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -432,7 +432,7 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "",
@@ -447,7 +447,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/es.json b/translations/es.json
index 4f5c02ac0..d665eb1d5 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -438,7 +438,7 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "",
@@ -453,7 +453,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/fr.json b/translations/fr.json
index ceb59135e..662c52458 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -439,7 +439,6 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "{{.count}} conteneurs suspendus dans : {{.namespaces}}",
 	"Pausing node {{.name}} ... ": "Suspendre le nœud {{.name}} ...",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "Autorisations : {{.octalMode}} ({{.writtenMode}})",
-	"Please also attach the following file to the GitHub issue:": "",
 	"Please attach the following file to the GitHub issue:": "Veuillez joindre le fichier suivant au problème GitHub :",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "Veuillez créer un cluster avec une plus grande taille de disque : `minikube start --disk SIZE_MB`",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "Veuillez vous authentifier auprès du registre ou utiliser l'indicateur --base-image pour utiliser un registre différent.",
@@ -455,7 +454,6 @@
 	"Please provide source and target image": "Veuillez fournir l'image source et cible",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "Veuillez réévaluer votre docker-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "Veuillez réévaluer votre podman-env, pour vous assurer que vos variables d'environnement ont des ports mis à jour :\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "Veuillez consulter {{.documentation_url}} pour plus de détails",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "Veuillez spécifier le répertoire à monter : \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (exemple : \"/host-home:/vm-home\")",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "Veuillez spécifier le chemin à copier : \n\tminikube cp \u003cchemin du fichier source\u003e \u003cchemin absolu du fichier cible\u003e (exemple : \"minikube cp a/b.txt /copied.txt\")",
diff --git a/translations/ja.json b/translations/ja.json
index 81bd7737b..a13338788 100644
--- a/translations/ja.json
+++ b/translations/ja.json
@@ -429,7 +429,7 @@
 	"Pausing node {{.name}} ...": "ノード {{.name}} を一時停止しています ...",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "",
@@ -444,7 +444,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/ko.json b/translations/ko.json
index 7849bef2b..c4311d27f 100644
--- a/translations/ko.json
+++ b/translations/ko.json
@@ -453,7 +453,7 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "값을 입력하세요",
@@ -468,7 +468,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/pl.json b/translations/pl.json
index a88e990b2..4c8bc37ac 100644
--- a/translations/pl.json
+++ b/translations/pl.json
@@ -446,7 +446,6 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "Zatrzymane kontenery: {{.count}} w przestrzeniach nazw: {{.namespaces}}",
 	"Pausing node {{.name}} ... ": "Zatrzymywanie węzła {{.name}} ... ",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
 	"Please attach the following file to the GitHub issue:": "Dołącz następujący plik do zgłoszenia problemu na GitHubie:",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "Utwórz klaster z większym rozmiarem dysku: `minikube start --disk SIZE_MB`",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "Uwierzytelnij się w rejestrze lub użyć flagi --base-image w celu użycia innego rejestru.",
@@ -462,7 +461,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "Zobacz {{.documentation_url}} żeby uzyskać więcej informacji",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "Sprecyzuj katalog, który ma być zamontowany: \n\tminikube mount \u003ckatalog źródłowy\u003e:\u003ckatalog docelowy\u003e   (przykład: \"/host-home:/vm-home\")",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/strings.txt b/translations/strings.txt
index b943fb9cc..afa97d7a1 100644
--- a/translations/strings.txt
+++ b/translations/strings.txt
@@ -407,7 +407,7 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "",
@@ -422,7 +422,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",
diff --git a/translations/zh-CN.json b/translations/zh-CN.json
index ab9509fe3..0700b140e 100644
--- a/translations/zh-CN.json
+++ b/translations/zh-CN.json
@@ -520,7 +520,7 @@
 	"Paused {{.count}} containers in: {{.namespaces}}": "",
 	"Pausing node {{.name}} ... ": "",
 	"Permissions:  {{.octalMode}} ({{.writtenMode}})": "权限：  {{.octalMode}} ({{.writtenMode}})",
-	"Please also attach the following file to the GitHub issue:": "",
+	"Please attach the following file to the GitHub issue:": "",
 	"Please create a cluster with bigger disk size: `minikube start --disk SIZE_MB` ": "",
 	"Please either authenticate to the registry or use --base-image flag to use a different registry.": "",
 	"Please enter a value:": "请输入一个值：",
@@ -535,7 +535,6 @@
 	"Please provide source and target image": "",
 	"Please re-eval your docker-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} docker-env'\n\n\t": "",
 	"Please re-eval your podman-env, To ensure your environment variables have updated ports:\n\n\t'minikube -p {{.profile_name}} podman-env'\n\n\t": "",
-	"Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.": "",
 	"Please see {{.documentation_url}} for more details": "",
 	"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e   (example: \"/host-home:/vm-home\")": "",
 	"Please specify the path to copy: \n\tminikube cp \u003csource file path\u003e \u003ctarget file absolute path\u003e (example: \"minikube cp a/b.txt /copied.txt\")": "",


Test patch:
diff --git a/pkg/minikube/out/out_test.go b/pkg/minikube/out/out_test.go
index acaf13ac4..ea0f729c8 100644
--- a/pkg/minikube/out/out_test.go
+++ b/pkg/minikube/out/out_test.go
@@ -21,12 +21,11 @@ import (
 	"os"
 	"path/filepath"
 	"strconv"
-	"strings"
 	"testing"
 
 	"github.com/Delta456/box-cli-maker/v2"
-	"github.com/spf13/pflag"
 
+	"k8s.io/minikube/pkg/minikube/localpath"
 	"k8s.io/minikube/pkg/minikube/style"
 	"k8s.io/minikube/pkg/minikube/tests"
 	"k8s.io/minikube/pkg/minikube/translate"
@@ -131,96 +130,37 @@ func createLogFile() (string, error) {
 	return f.Name(), nil
 }
 
-func TestLatestLogFilePath(t *testing.T) {
-	want, err := createLogFile()
+func TestLatestLogPath(t *testing.T) {
+	filename, err := createLogFile()
 	if err != nil {
 		t.Fatal(err)
 	}
-	defer os.Remove(want)
+	defer os.Remove(filename)
 
-	got, err := latestLogFilePath()
-	if err != nil {
-		t.Errorf("latestLogFilePath() failed with error = %v", err)
-	}
-	if got != want {
-		t.Errorf("latestLogFilePath() = %q; wanted %q", got, want)
-	}
-}
-
-func TestCommand(t *testing.T) {
 	testCases := []struct {
-		args        []string
-		want        string
-		shouldError bool
+		args []string
+		want string
 	}{
 		{
 			[]string{"minikube", "start"},
-			"start",
-			false,
-		},
-		{
-			[]string{"minikube", "--profile", "profile1", "start"},
-			"start",
-			false,
+			localpath.LastStartLog(),
 		},
 		{
-			[]string{"minikube"},
-			"",
-			true,
+			[]string{"minikube", "status"},
+			filename,
 		},
 	}
 
-	pflag.String("profile", "", "")
-
 	for _, tt := range testCases {
 		oldArgs := os.Args
 		defer func() { os.Args = oldArgs }()
 		os.Args = tt.args
-		pflag.Parse()
-		got, err := command()
-		if err == nil && tt.shouldError {
-			t.Errorf("os.Args = %s; command() did not fail but was expected to", tt.args)
-		}
-		if err != nil && !tt.shouldError {
-			t.Errorf("os.Args = %s; command() failed with error = %v", tt.args, err)
+		got, err := latestLogFilePath()
+		if err != nil {
+			t.Fatalf("os.Args = %s; latestLogFilePath() failed with error = %v", tt.args, err)
 		}
 		if got != tt.want {
-			t.Errorf("os.Args = %s; command() = %q; wanted %q", tt.args, got, tt.want)
-		}
-	}
-}
-
-func TestDisplayGitHubIssueMessage(t *testing.T) {
-	testCases := []struct {
-		args                 []string
-		shouldContainMessage bool
-	}{
-		{
-			[]string{"minikube", "start"},
-			false,
-		},
-		{
-			[]string{"minikube", "delete"},
-			true,
-		},
-	}
-
-	msg := "Please also attach the following file to the GitHub issue:"
-
-	for _, tt := range testCases {
-		oldArgs := os.Args
-		defer func() { os.Args = oldArgs }()
-		os.Args = tt.args
-		pflag.Parse()
-		f := tests.NewFakeFile()
-		SetErrFile(f)
-		displayGitHubIssueMessage()
-		output := f.String()
-		if strings.Contains(output, msg) && !tt.shouldContainMessage {
-			t.Errorf("os.Args = %s; displayGitHubIssueMessage() output = %q; did not expect it to contain = %q", tt.args, output, msg)
-		}
-		if !strings.Contains(output, msg) && tt.shouldContainMessage {
-			t.Errorf("os.Args = %s; displayGitHubIssueMessage() output = %q; expected to contain = %q", tt.args, output, msg)
+			t.Errorf("os.Args = %s; latestLogFilePath() = %q; wanted %q", tt.args, got, tt.want)
 		}
 	}
 }